This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
answer() | |
result = ask("What's your destination?", [ | |
choices: "http://gist.github.com/raw/559213/c83cf025a22acab46ec9e5691c69deff76ce3b7b/grammar.grxml"]) | |
say("You chose $result.value") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
answer() | |
say("<?xml version="1.0" encoding="UTF-8"?><speak>One potato, two potato, three potato, four.<prosody rate="-10%">One potato, two potato, three potato, four.</prosody><prosody rate="-30%">One potato, two potato, three potato, four.</prosody><prosody rate="-50%">One potato, two potato, three potato, four.</prosody></speak>") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
puts 'What is your name?' | |
name = gets.chomp | |
puts 'What is your age?' | |
age = gets.chomp | |
puts "Well, #{name}, next year you will be #{age.to_i+1}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# A github post-receive hook handler, runs some shell command on each HTTP POST to PORT. | |
# github-listener.py PORT 'SOME SHELL COMMAND' | |
import sys | |
from subprocess import * | |
from flask import Flask | |
def system(cmd): | |
print ''.join(Popen(cmd, shell=True, stdout=PIPE, stderr=PIPE, close_fds=True).communicate()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once 'lib/limonade.php'; | |
function configure() | |
{ | |
option('session', 'my_session_name'); // enable with a specific session name | |
} | |
dispatch('/', 'example_index'); | |
function example_index() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
answer(); | |
// if its me, ask me for a number to call | |
if(currentCall.callerID == "_your_phone_number_" || currentCall.callerID == "your_sip_url_"){ | |
var result = ask("Enter the 10 digit phone number now.", { | |
choices: "[10 DIGITS]", | |
attempts: 3 | |
}); | |
transfer("tel:+1"+result.value,{ | |
callerID : "111", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'tweetstream' | |
APP_PATH = File.expand_path('../../config/application', __FILE__) | |
require File.expand_path('../../config/boot', __FILE__) | |
require APP_PATH | |
Rails.application.require_environment! | |
TweetStream.configure do |config| | |
config.consumer_key = 'redacted' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html style="width:100%; height:100%; overflow:hidden"> | |
<body style="width:100%; height:100%; overflow:hidden; margin:0"> | |
<script> | |
function qr(data, format) { | |
WS.publish('urlopen', atob(data)); | |
} | |
function server() { | |
WS.say('Scan a QR Code'); | |
WS.qr('qr'); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html style="width:100%; height:100%; overflow:hidden" data-test> | |
<head> | |
<!--<script src="https://cdnjs.cloudflare.com/ajax/libs/zepto/1.0/zepto.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.5.2/underscore-min.js"></script>--> | |
</head> | |
<body style="width:100%; height:100%; overflow:hidden; margin:0"> | |
<canvas id="canvas" width="640" height="360" style="display:block"></canvas> | |
<script> | |
WS.log('Welcome to WearScript'); | |
WS.say('Wearscript is awesome'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# In the following code, the two gsub's have different outcomes. | |
ver = 9999 | |
str = "\t<key>CFBundleDevelopmentRegion</key>\n\t<string>en</string>\n\t<key>CFBundleVersion</key>\n\t<string>0.1.190</string>\n\t<key>AppID</key>\n\t<string>000000000000000</string>" | |
puts str.gsub /(CFBundleVersion<\/key>\n\t.*\.).*(<\/string>)/, "#{$1}#{ver}#{$2}" | |
puts '--------' | |
puts str.gsub /(CFBundleVersion<\/key>\n\t.*\.).*(<\/string>)/, "#{$1}#{ver}#{$2}" |