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
| const int ledsLength = 3; | |
| int leds[ledsLength] = {0, 1, 2}; | |
| int delaySpeed = 25; | |
| int x = 0; | |
| void turnOnLed(int led); | |
| void turnOffLed(int led); | |
| void turnOnLeds(int leds[]); | |
| void turnOffLeds(int leds[]); | |
| void flashLeds(int leds[], int speed); |
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
| // Check Twitter username & password | |
| - (void)initiateCredentialCheckWithUsername:(NSString *)username password:(NSString *)password { | |
| self.authCID = [self.twitterEngine getXAuthAccessTokenForUsername:username password:password]; | |
| self.twitterUsername = username; | |
| } | |
| - (void)requestFailed:(NSString *)requestIdentifier withError:(NSError *)error { | |
| NSLog(@"Request failed"); | |
| NSLog(@"%@", requestIdentifier); | |
| NSLog(@"%@", error); |
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 'rubygems' | |
| require 'net/http' | |
| # This fails | |
| Thread.new { | |
| uri = URI.parse('http://postbin.heroku.com/3v') | |
| Net::HTTP.post_form(uri, {'data'=> 'fail'}) | |
| } | |
| # This works |
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
| post '/messages_async' do | |
| Thread.new(params[:data]) do |params_data| | |
| data = JSON.parse(params_data) | |
| channel_name = data['channel'] || 'boo' | |
| message = data['message'] || nil | |
| if record = Channel.first(:name => channel_name) | |
| if message and record.id | |
| subscribers = Subscriber.all(:channel_id => record.id) | |
| if subscribers |
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 DB | |
| @@database_path = File.dirname(__FILE__) + '/../db/db.yaml' | |
| attr_accessor :data | |
| def initalize | |
| load | |
| end | |
| def write(data) |
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
| (function($) { | |
| $.fn.opacityCheck = function(key) { | |
| if (key == ':visible') { | |
| if (this.css('opacity') == 1) { | |
| return true; | |
| } | |
| return false; | |
| } | |
| else if (key == ':invisible') { | |
| if (this.css('opacity') == 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
| console.log(${1:'firing'}); |
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
| // Check to make sure this is going to be the only | |
| // occupant of the new coordinates. | |
| var that = this; | |
| var createCoords = function() { | |
| var o = []; | |
| // coords[0] = helpers.generateRandomNumber(this.BOARD_WIDTH - 1); | |
| // coords[1] = helpers.generateRandomNumber(this.BOARD_HEIGHT - 1); | |
| o[0] = helpers.generateRandomNumber(2); |
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
| if (typeof l == undefined) { | |
| var l = function(v) { | |
| if (typeof console != undefined && typeof console.log != undefined) { | |
| console.log(v); | |
| } | |
| } | |
| } |
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
| #!/bin/sh | |
| echo "Firing up the servers baby!" | |
| sleep 1 | |
| cd /var/steam/orangebox | |
| screen -m -d -t hl2mp1 -S steam ./srcds_run -console -game hl2mp +map dm_underpass -autoupdate -port 30100 | |
| screen -m -d -t hl2mp2 -S steam ./srcds_run -console -game hl2mp +map dm_underpass -autoupdate -port 30200 |
OlderNewer