Oct 16 2010
- 04/10/2011 - Updated application.js and application.rb thanks to @rebo's comments
In this article, I will walk through some simple steps to get a [demo app][2] up and running with [Backbone.js][3] and [Sinatra][4] on [Heroku][5].
| Surround these with : e.g. :calling: | |
| +1 | |
| -1 | |
| bulb | |
| calling | |
| clap | |
| cop | |
| feet |
| <?php | |
| /** | |
| * A simple Facebook PHP example. | |
| * | |
| * - This is not a "Facebook SDK". | |
| * - This example uses Curl, Hash, JSON, Session extensions. | |
| * - This does not use the JavaScript SDK, nor the cookie set by it. | |
| * - This works with Canvas, Page Tabs with IFrames, the Registration Plugin | |
| * and with any other flow which uses the signed_request. |
| <?php | |
| /* | |
| Adding First and Last Name to Checkout Form | |
| */ | |
| //add the fields to the form | |
| function my_pmpro_checkout_after_password() | |
| { | |
| if(!empty($_REQUEST['firstname'])) | |
| $firstname = $_REQUEST['firstname']; |
| 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 |
| #!/bin/bash | |
| LINES=$(tput lines) | |
| COLUMNS=$(tput cols) | |
| declare -A snowflakes | |
| declare -A lastflakes | |
| clear |
| <?php | |
| #Requires PHP 5.3.0 | |
| define("CONSUMER_KEY", "consumer_key"); | |
| define("CONSUMER_SECRET", "consumer_secret"); | |
| define("OAUTH_TOKEN", "access_token"); | |
| define("OAUTH_SECRET", "access_secret"); | |
| function oauth_gen($method, $url, $iparams, &$headers) { |
| #!/usr/bin/env ruby | |
| # | |
| # Whatsapp status crawler for Central America mobile phone numbers. | |
| # | |
| # Based on a SBD post by Alejandro Ramos: | |
| # http://www.securitybydefault.com/2012/03/casi-10-millones-de-moviles-espanoles.html | |
| # | |
| # Modified by @hugogilmar & @andrexu for mobile phone numbers in El Salvador | |
| #-------------------------------------------------------------------------------------- | |
| # You must change some parameters matching to your country, your country code, for example. HAVE FUN! |
| The bridge is now located at https://github.com/fjolnir/TLC |
| import urlparse | |
| import oauth2 as oauth | |
| consumer_key = 'consumer_key' | |
| consumer_secret = 'consumer_secret' | |
| request_token_url = 'http://www.tumblr.com/oauth/request_token' | |
| access_token_url = 'http://www.tumblr.com/oauth/access_token' | |
| authorize_url = 'http://www.tumblr.com/oauth/authorize' |