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
#set ctrl+a as prefix (set CAPS LOCK as CTRL) | |
unbind C-b | |
set -g prefix C-a | |
bind C-a send-prefix | |
#keys repetition | |
set repeat-time 0 | |
set -s escape-time 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
function parse_git_branch { | |
ref=$(git symbolic-ref HEAD 2> /dev/null) || return; | |
echo "["${ref#refs/heads/}"]" | |
} | |
PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[01;31m\]$(parse_git_branch)\[\033[00m\]\$ ' |
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
//Convert the 128x128 image with: | |
// convert image.jpg image.rgb | |
res=128 | |
img_file = File.open(ARGV[0],'r') | |
puts "static char image[#{res*res}] = { " | |
img_file.bytes.each_slice(res) do |l| | |
puts " #{l.join(',')}" | |
end |
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 "AnalogButtons.h" | |
int led_pin = 13; | |
int res_pin = A0; | |
int interrupt_pin = 0; | |
volatile int msec = 1000; | |
#define MODE_EDIT 0 | |
#define MODE_RUN 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
jQuery.fn.extend({ | |
position: function() { | |
if ( !this[0] ) { | |
return null; | |
} | |
var elem = this[0], | |
// Get *real* offsetParent | |
offsetParent = this.offsetParent(), |
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
PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' |
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 'faye' | |
client = Faye::Client.new('http://localhost:8000/auctions') | |
EM.run do | |
10.times do |n| | |
client.publish("/#{n}", { | |
msg: 'obladioblada', | |
id: 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
var http = require('http'), | |
faye = require('faye'); | |
var bayeux = new faye.NodeAdapter({mount: '/test', timeout: 45}); | |
bayeux.listen(8000); |
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
[ec2-user@ip-10-170-205-102 ~]$ rackup faye.ru -s thin -E production -p 8080 | |
>> Thin web server (v1.2.11 codename Bat-Shit Crazy) | |
>> Maximum connections set to 1024 | |
>> Listening on 0.0.0.0:8080, CTRL+C to stop | |
/home/ec2-user/.rvm/gems/ruby-1.9.2-p180/gems/eventmachine-0.12.10/lib/eventmachine.rb:375:in `add_oneshot_timer': ran out of timers; use #set_max_timers to increase limit (RuntimeError) | |
from /home/ec2-user/.rvm/gems/ruby-1.9.2-p180/gems/eventmachine-0.12.10/lib/eventmachine.rb:375:in `add_timer' | |
from /home/ec2-user/.rvm/gems/ruby-1.9.2-p180/gems/faye-0.5.5/lib/faye/mixins/timeouts.rb:7:in `add_timeout' | |
from /home/ec2-user/.rvm/gems/ruby-1.9.2-p180/gems/faye-0.5.5/lib/faye/protocol/connection.rb:104:in `begin_deletion_timeout' | |
from /home/ec2-user/.rvm/gems/ruby-1.9.2-p180/gems/faye-0.5.5/lib/faye/protocol/connection.rb:89:in `release_connection!' | |
from /home/ec2-user/.rvm/gems/ruby-1.9.2-p180/gems/faye-0.5.5/lib/faye/protocol/connection.rb:66:in `flush!' |
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
#using rack (delay in seconds) 10 client | |
[85520] diff: -0.12716197967529297 | |
[85518] diff: -0.12726306915283203 | |
[85513] diff: -0.11838006973266602 | |
[85514] diff: -0.11852812767028809 | |
[85515] diff: -0.11935830116271973 | |
[85517] diff: -0.11937212944030762 | |
[85520] diff: -0.12018418312072754 | |
[85519] diff: -0.12038922309875488 | |
[85518] diff: -0.12056493759155273 |