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 http = require('http'), | |
| should = require('should'), | |
| io = require('socket.io'), | |
| decode = require('.npm/socket.io/0.6.8/package/lib/socket.io/utils').decode, | |
| encode = require('.npm/socket.io/0.6.8/package/lib/socket.io/utils').encode, | |
| WebSocket = require('.npm/socket.io/0.6.8/package/support/node-websocket-client/lib/websocket.js').WebSocket; | |
| exports['Socket.IO mocking'] = function(assert){ | |
| var _server = require('http').createServer(function(){}); | |
| // A mock client object. |
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
| return filter.map do |f| | |
| o = @overlords.find{ |o| o.name == f } | |
| raise "Invalid filter: #{f}" unless o | |
| o | |
| end | |
| vs | |
| return filter.map do |f| | |
| @overlords.find{ |o| o.name == f } or raise "Invalid filter: #{f}" |
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 'logger' | |
| require 'rest_client' | |
| $stdout.sync = true | |
| $stdin.sync = true | |
| path = "/usr/local/var/log/ejabberd/auth.log" | |
| file = File.open(path, File::WRONLY | File::APPEND | File::CREAT) |
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
| Creating Firefox profile in '/Users/abloom/Library/Application Support/Firefox/Profiles/b0ef4sie.xultestrunner' | |
| Running tests... | |
| 2011-01-20 08:13:03.939 firefox-bin[25902:903] *** __NSAutoreleaseNoPool(): Object 0x268d9e0 of class NSCFString autoreleased with no pool in place - just leaking | |
| 2011-01-20 08:13:03.943 firefox-bin[25902:903] *** __NSAutoreleaseNoPool(): Object 0x2691000 of class NSPathStore2 autoreleased with no pool in place - just leaking | |
| 2011-01-20 08:13:03.944 firefox-bin[25902:903] *** __NSAutoreleaseNoPool(): Object 0x2691490 of class NSPathStore2 autoreleased with no pool in place - just leaking | |
| 2011-01-20 08:13:03.945 firefox-bin[25902:903] *** __NSAutoreleaseNoPool(): Object 0x2691570 of class NSPathStore2 autoreleased with no pool in place - just leaking | |
| 2011-01-20 08:13:03.945 firefox-bin[25902:903] *** __NSAutoreleaseNoPool(): Object 0x20806d0 of class NSPathStore2 autoreleased with no pool in place - just leaking | |
| 2011-01-20 08:13:03.946 firefox-bin[25902:903] *** __NSAutoreleaseNoPool |
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
| void delay(unsigned long int cycles) { | |
| do (cycles--); | |
| while (cycles != 0); | |
| } |
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
| state = P1IN & BIT4; | |
| if (state && (currentState != state)) { // P1.4 hi | |
| currentState = state; | |
| currentMessage = currentChar = (char *) message2; | |
| } else if (!state && (currentState != state)) { // P1.4 lo | |
| currentState = state; | |
| currentMessage = currentChar = (char *) message1; | |
| } |
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
| for (;;) { | |
| switch(*currentChar) { | |
| case '#': | |
| printHash(); | |
| break; | |
| case ' ': | |
| delay(SPACE_DELAY); | |
| break; | |
| case '\0': | |
| currentChar = (char *) currentMessage - 1; // -1 since we += 1 below |
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
| #include <msp430x20x3.h> | |
| #define UNIT_DELAY 100000 | |
| #define DOT_DELAY UNIT_DELAY | |
| #define DASH_DELAY (UNIT_DELAY * 3) | |
| #define LETTER_DELAY (UNIT_DELAY * 3) | |
| #define SPACE_DELAY (UNIT_DELAY * 7) | |
| #define ON 1 | |
| #define OFF 0 | |
| #define LED1 BIT0 |
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 'logger' | |
| $stdout.sync = true | |
| $stdin.sync = true | |
| path = "/usr/local/var/log/ejabberd/auth.log" | |
| file = File.open(path, File::WRONLY | File::APPEND | File::CREAT) | |
| file.sync = true |
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
| class Rack::Request | |
| def host_with_port | |
| if forwarded = @env["HTTP_X_FORWARDED_HOST"] | |
| forwarded.split(/,\s?/).last | |
| else | |
| @env['HTTP_HOST'] || "#{@env['SERVER_NAME'] || @env['SERVER_ADDR']}:#{@env['SERVER_PORT']}" | |
| end | |
| end | |
| def host |