8 ms·
PHP in a Tweet
- stdclass 13y agoThere was something similar with JavaScript called 140byt.es [1] [1] http://140byt.es/ http://140byt.es/
- joeframbach 13y agoThe first one isn't very good. The slashes are optional anyway. http://bits.blogs.nytimes.com/2009/10/12/the-webs-inventor-regrets-one-small-thing http://bits.blogs.nytimes.com/2009/10/12/the-webs-inventor-r...
- crucialfelix 13y agopeople have been creating 140 character music pieces in the supercollider music language for a while. its very tricky to make something that lasts and evolves and has structure and keeps your interest. here are some great ones: http://fredrikolofsson.com/f0blog/?q=node/478 http://fredrikolofsson.com/f0blog/?q=node/478 play{a=SinOscFB;sum({|i|a.ar(a.ar(a.ar(a.ar(i+1,1/9,999),1/9,a.ar(1/9,1,1/9)),a.ar(0.1,3),i+2999),a.ar(1/9,1/9),1/9)}!9)!2}//#SuperCollider r{loop{x={GVerb.ar(MoogFF.ar(ClipNoise.ar0.4,LFPar.kr({0.3.rand}!2,0,600,990)),9,9,1)}.play(s,0,19);3.wait;x.release}}.play//#SuperCollider audio examples on the page above
- crucialfelix 13y agothis one is amazing: play{a=LFPulse;b=(1..4);Mix(a.ar(a.ar(a.ar(a.ar(b/32)+1/8)+1b)+(Mix(a.ar(b/64))+a.ar(4/b)(a.ar(a.ar(b/8))2+b))100))/8!2}//#SuperCollider audio: http://fredrikolofsson.com/f0blog/files/audio/tweet0020.mp3 http://fredrikolofsson.com/f0blog/files/audio/tweet0020.mp3 "this tweet is also totally deterministic and without any randomness. here a lot of nested square wave oscillators creates the complexity. basically there are 4 channels/voices mixed down to one and then duplicated in left and right channel. there are three levels deep nesting of frequency modulation with another set of square waves mixed and added."
- _quasimodo 13y agoReminds me of those: http://www.youtube.com/watch?v=GtQdIYUtAHg http://www.youtube.com/watch?v=GtQdIYUtAHg http://www.youtube.com/watch?v=qlrs2Vorw2Y http://www.youtube.com/watch?v=qlrs2Vorw2Y http://www.youtube.com/watch?v=tCRPUv8V22o http://www.youtube.com/watch?v=tCRPUv8V22o :)
- crucialfelix 13y agoYeah I remember those ! In fact I did some bit shift melody stuff myself in supercollider based on those and some other code. One of the sc people released an iPhone app that let's you write bitshift based melodies. The early stuff that supercolliders creator James McCartney did really set the style for short, mathematically elegant music. It's really a great language for it. You can do operations on arrays, and do interesting multichannel expansion.
- purge 13y agoDon't invite Perl to this party
- erikig 13y agoToo late, and she brought JavaScript too...
- contingencies 13y agoWow, Perl's seen better days but I think they're a good match for each other. Perl's fascinated by JavaScript's objectivity and popularity, and JavaScript's wearing Perl for retro effect like some kind of fashion item. The two of them are like darkness and light. No prize for guessing who brought the drugs...
- whalesalad 13y agoI enjoy PHP like I enjoy going home to see my family for the holidays. It's fun for a bit, the nostalgia makes me feel warm and fuzzy, and the familiarity of everything is very comforting. You quickly realize though that the grass really is a lot greener on the other side. You remember why you moved out of your parent's place and went out on your own. It's hilarious looking at how cryptic these one-liners are, particularly when I consider that with languages like Ruby and Python you can do a LOT with a tiny little line if code. As a side-note, one of my favorites is summing an array in Ruby: x = [1, 2, 3, 4, 5] x.inject &:+ => 15
- dugmartin 13y agoOr one true line in APL: +/ 1 2 3 4 5
- lkey 13y agoSince we are golfing... +/⍳5
- sevenproxies 13y agoIn PHP array_sum([1, 2, 3, 4, 5]);
- DorianMarie 13y agoarray_sum_of_1_2_3_4_5(); (Added in PHP 6)
- clienthunter 13y agoI raise PHP and MySQL in a Tweet. http://bit.ly/1hA9mZn http://bit.ly/1hA9mZn
- eksith 13y agoAt the risk of arousing some people's ire, I really like these tidbits that try to squeeze maximum functionality (albeit a bit dangerous) into a minimum span of characters. It feels a bit like the underhanded C contest in a way since there are so many magnificent ways to self-destruct doing this, but at the same time it's a fun challenge. A while ago, I put together a dirt-simple URL shortener https://twitter.com/eksith/statuses/275709375665037312 https://twitter.com/eksith/statuses/275709375665037312 A bit of background: http://eksith.wordpress.com/2012/12/03/id-obfuscation http://eksith.wordpress.com/2012/12/03/id-obfuscation
- mappu 13y agoAbout ID obfuscation: i like to use a small-width block cipher (e.g. 32-bit skipjack). A reversible int->int transform means you don't need an extra DB column, you're never prone to CRC32 collisions, you can still use base36 (why not case-sensitive base62?) for URLs, and with an application secret key there's no chance of reversal. Well, maybe someone could aim to get many sequential keys and then reverse-engineer the state of the cipher, but that's also possible with your method.
- k3n 13y agoYou might also like: http://www.reddit.com/r/tinycode http://www.reddit.com/r/tinycode
- eksith 13y agoWow! I do also like that. I like that very much! Thank you for pointing me to that.
- icebraining 13y agoThe Code Golf SE site is fun too: http://codegolf.stackexchange.com/ http://codegolf.stackexchange.com/
- draegtun 13y agoYou might find Rebmu interesting, its a Rebol dialect designed for code golfing - https://github.com/hostilefork/rebmu https://github.com/hostilefork/rebmu Here's a fun(!) presentation of Rebmu given by Dr. Rebmuthalamonious Golfstanipetrovitch (!!) given at the recent Rebol/Red conference - http://www.youtube.com/watch?v=iDKaz1iB9wQ http://www.youtube.com/watch?v=iDKaz1iB9wQ Enjoy! :)
- iguana 13y agoI see your PHP and raise you this Perl: http://pastebin.com/7UqSFWz7 http://pastebin.com/7UqSFWz7
- notJim 13y agoA friend of mine has an MVC library where each component fits in a tweet: https://github.com/jeremeamia/tweetmvc-core/blob/master/tweetmvc.php https://github.com/jeremeamia/tweetmvc-core/blob/master/twee...
- aaronem 13y agoI'm really conflicted on what opinion to have of this. On the one hand, these PHP constructs are even worse than most of what you see in that language, but on the other hand, constraining PHP sources to a maximum length of 140 characters should help reduce the scope of the contagion.
- draegtun 13y agoUnfortunately it's only available via WayBackMachine now but there was a fun Webapp in a 140 character tweet challenge back in the day (2009!) - http://web.archive.org/web/20111221094809/http://f055.net/article/final-wrap-up-of-the-140-characters-webapp-challenge/ http://web.archive.org/web/20111221094809/http://f055.net/ar...