This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
| # Video: http://rubyhoedown2008.confreaks.com/08-chris-wanstrath-keynote.html | |
| Hi everyone, I'm Chris Wanstrath. | |
| When Jeremy asked me to come talk, I said yes. Hell yes. Immediately. But | |
| then I took a few moments and thought, Wait, why? Why me? What am I supposed | |
| to say that's interesting? Something about Ruby, perhaps. Maybe the | |
| future of it. The future of something, at least. That sounds | |
| keynote-y. | |
| ּ_בּ | |
| בּ_בּ | |
| טּ_טּ | |
| כּ‗כּ | |
| לּ_לּ | |
| מּ_מּ | |
| סּ_סּ | |
| תּ_תּ | |
| ٩(×̯×)۶ | |
| ٩(̾●̮̮̃̾•̃̾)۶ |
| import threading | |
| from wsgiref.simple_server import make_server | |
| def serve_once(handler, port=4442): | |
| """ Single serving web server | |
| Creates a web server in another thread that will output the result of | |
| handler for a single request. Returns a URL to hit the web server. | |
| """ | |
| def app(e, start): |
| %w(rubygems sequel fileutils yaml active_support/inflector).each{|g| require g} | |
| require File.join(File.dirname(__FILE__), "downmark_it") | |
| module WordPress | |
| def self.import(database, user, password, table_prefix = "wp", host = 'localhost') | |
| db = Sequel.mysql(database, :user => user, :password => password, :host => host, :encoding => 'utf8') | |
| %w(_posts _drafts images/posts/featured).each{|folder| FileUtils.mkdir_p folder} |
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
This gist is a fork of the gist from this blog post.
| #!/bin/bash | |
| # | |
| # Watch current directory (recursively) for file changes, and execute | |
| # a command when a file or directory is created, modified or deleted. | |
| # | |
| # Written by: Senko Rasic <senko.rasic@dobarkod.hr> | |
| # | |
| # Requires Linux, bash and inotifywait (from inotify-tools package). | |
| # | |
| # To avoid executing the command multiple times when a sequence of |
| Found this tip in comment here: http://www.tipb.com/2011/01/04/tipb-bug-home-button-working-iphone/ | |
| 1.) Open any application | |
| 2.) Press and hold the power button until the slide to shutdown swipe bar appears. | |
| 3.) Release Power button | |
| 4.) Press and hold Home button Lightly | |
| until screen returns to icon screen |
| // Copyright (C) 2011 by Christoph Hack. All rights reserved. | |
| // Use of this source code is governed by the New BSD License. | |
| /* | |
| This program contains a simple micro-benchmark for a Disruptor [1] like | |
| event buffer (or at least what I think that Disruptor might be). There | |
| isn't any kind of API yet and this test is currently limited to a | |
| single producer - single consumer architecture, but generally the | |
| architecture of Disruptor is also well suited for multiple producers and | |
| consumers. |
| require 'rest_client' | |
| require 'json' | |
| a = `sox -d --norm -t .flac - silence -l 1 0 1% 1 6.0 1% rate 16k` | |
| #a = `arecord -q -d 3 -c 1 -f S16_LE -r 22050 -t wav | flac - -f --totally-silent -o-` | |
| r = RestClient.post 'https://www.google.com/speech-api/v1/recognize?lang=en-US', a, | |
| :content_type => 'audio/x-flac; rate=16000' | |
| if j = JSON.parse(r) | |
| (p j; `espeak 'you said: #{j['hypotheses'].first['utterance']}'`) | |
| end |