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/php | |
| <?php | |
| /* | |
| * Send X10 commands to this proxy script like "!on A4" with the following function | |
| * | |
| * function send_x10_command($msg) | |
| * { | |
| * $udpstr = serialize(array('command'=>$msg)); | |
| * $sock = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP); |
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('tropo-webapi-php/tropo.class.php'); | |
| define('IRC_SERVER', 'example.com'); | |
| define('IRC_UDP_PORT', 51000); | |
| $session = new Session(); | |
| // Read text from incoming SMS | |
| $text = $session->getInitialText(); |
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
| var G = google.maps.geometry.spherical; | |
| var A = placeMarker.getPosition(); | |
| var B = event.latLng; | |
| var radians = function(degrees) { return degrees * (Math.PI/180); }; | |
| // Compute the angle from A to B | |
| var beta = G.computeHeading(A, B); |
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
| /* | |
| * This regex should look for regexes like s/a/b and capture both 'a' and 'b' separately. | |
| * It's not very good yet. You can make it better if you want. | |
| * Ready? go. | |
| */ | |
| /^s\/(.+)\/(.+)/ |
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('php-mime-mail-parser/MimeMailParser.class.php'); | |
| require_once(dirname(__FILE__) . '/Regex.php'); | |
| require_once(dirname(__FILE__) . 'smsified.class.php'); | |
| // get the email from STDIN | |
| $buffer = ''; | |
| while(!feof(STDIN)) | |
| $buffer .= fgets(STDIN); |
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 | |
| /* | |
| echo 'These are the variables defined by the environment'."\n"; | |
| echo '$action = '.$action."\n"; | |
| echo '$message = '.$message."\n"; | |
| echo '$nick = '.$nick."\n"; | |
| echo '$username = '.$username."\n"; | |
| echo '$channel = '.$channel."\n"; | |
| echo '$command_target = '.$command_target."\n"; | |
| echo '$params = '.$params."\n"; |
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 | |
| $error[] = 'Sorry, I couldn\'t parse that'; | |
| $error[] = 'That doesn\'t look like a date'; | |
| $error[] = 'Hmm, no clue'; | |
| $error[] = 'What?'; | |
| $error[] = 'Sorry.'; | |
| $error[] = 'I give up'; | |
| $success[] = 'That looks like a unix timestamp!'; |
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
| make | |
| g++ -I. -I/home/web/.rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1/i686-linux -I/home/web/.rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1/ruby/backward -I/home/web/.rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1 -I../../../../ext/ruby_mapnik -D_FILE_OFFSET_BITS=64 -I/home/web/.rvm/gems/ruby-1.9.2-p290@Geoloqi-Developer-Site/gems/rice-1.4.2/ruby/lib/include -fPIC -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wno-long-long -fPIC -I/usr/include -I/usr/include -I/usr/include/freetype2 -I/usr/include/libxml2 -I/usr/include/postgresql -I/usr/include/gdal -DHAVE_JPEG -DBOOST_REGEX_HAS_ICU -ansi -Wall -pthread -ftemplate-depth-200 -DLINUX -DBOOST_SPIRIT_THREADSAFE -DMAPNIK_THREADSAFE -O3 -finline-functions -Wno-inline -DNDEBUG -DHAVE_CAIRO -DLIBTOOL_SUPPORTS_ADVISE -DHAVE_LIBXML2 -I/usr/include/glib-2.0 -I/usr/lib/i386-linux-gnu/glib-2.0/include -I/usr/include/libpng12 -I/usr/include/cairomm-1.0 -I/usr/lib/cairomm-1.0/include -I/usr/inc |
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
| { "name" : "browser-proxy", | |
| "version" : "1.0.0", | |
| "dependencies" : { "hiredis" : "0.1.12", | |
| "redis" : "0.6.6", | |
| "hoptoad-notifier" : "0.1.3", | |
| "socket.io" : "0.8.4", | |
| "optimist" : "0.2.6" } | |
| } |
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
| require 'socket' | |
| s = UDPSocket.new | |
| s.bind(nil, 43333) | |
| while(true) do | |
| text, sender = s.recvfrom(39) | |
| puts | |
| 71.times{print "="} | |
| puts | |
| puts "Received message from " + sender[3].to_s + ":" + sender[1].to_s |