This is a small snippet that gives Javascript arrays the (much-needed) ability to remove elements based on value. Example:
items = [1,2,3,3,4,4,5];
items.remove(3); // => [1,2,4,4,5]
class Application(object): | |
greenlet = None | |
def __call__(self, environ, start_response): | |
path = environ['PATH_INFO'].strip('/') | |
if path.startswith("socket.io"): | |
socketio = environ['socketio'] | |
while True: | |
message = socketio.recv() |
This is a small snippet that gives Javascript arrays the (much-needed) ability to remove elements based on value. Example:
items = [1,2,3,3,4,4,5];
items.remove(3); // => [1,2,4,4,5]
#!/bin/sh | |
# Ref: http://ubuntuforums.org/showthread.php?t=1751455 | |
# Uninstall PIL | |
# sudo pip uninstall PIL -q | |
# Install required libs | |
apt-get --yes install build-essential python-dev zlib1g-dev liblcms1-dev libjpeg8 libjpeg62-dev libfreetype6 libfreetype6-dev | |
# Link to correct location |
0e3647e8592d35514a081243582536ed3de6734059001e3f535ce6271032 | |
334b041de124f73c18011a50e608097ac308ecee501337ec3e100854201d | |
40e127f51c10031d0133590b1e490f3514e05a54143d08222c2a4071e351 | |
45440b171d5c1b21342e021c3a0eee7373215c4024f0eb733cf006e2040c | |
22015e420b07ef21164d5935e82338452f42282c1836e42536284c450de3 | |
043b452e0268e7eb005a080b360f0642e6e342005217ef04a42f3e43113d | |
581e0829214202063d70030845e5301f5a5212ed0818e22f120b211b171b | |
ea0b342957394717132307133f143a1357e9ed1f5023034147465c052616 | |
0c300b355c2051373a051851ee154a023723414c023a08171e1b4f17595e | |
550c3e13e80246320b0bec09362542243be42d1d5d060e203e1a0c66ef48 |
I have now hit my first "wow" moment with Rails, where I actually understood why it has the following it does. It has raised some questions for me about the pedagogy of Rails, but that is not the language's fault; it is a question for the community.
Rails is fast. Mind-blowingly fast. From my cursory looks at the framework, it is immediately apparent that this was designed from the ground up to give me everything I'm going to inevitably want in a basic web application. And yet, for some reason, it isn't immediately sold that way. It's instead sold with stuff like...
"I'm not even joking when I say this, but I think some of the resources out there make it intentionally hard for non-technical people to start learning."
The above line was from a class on Rails - not a Ruby class, but a Rails class. The class was designed so that you could have no coding experience whatsoever and build an MVP, and it advertises itself as such. I think learning to code, even at the lowest level of difficulty, is a fantast
<!doctype html> | |
<html> | |
<head> | |
<link rel='stylesheet' src='main.css' /> | |
</head> | |
<body> | |
<div class='center-outer'> | |
<div class='center-inner'> | |
This is a test. <img src='http://placehold.it/200x200' /> And an image. | |
</div> |
''.join(random.sample(string.letters+string.digits, 40)) |
''.join(random.sample(string.letters+string.digits, 40)) |
A lot of the time, crash reports sent via email get a bit garbled over the wire, and Xcode won't symbolicate them. It turns out that a lot of email clients (including Apple Mail) are the cause of this.
This script takes a crash report and cleans it up so that Xcode likes it.
Usage:
$ cat example.crash | cleanup.py