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
donp hack req.headers {"PATH"=>"/blog", "x-forwarded-for"=>"::ffff:173.8.218.204", "cache-control"=>"max-age=0", "accept-language"=>"en-us,en;q=0.5", "connection"=>"keep-alive", "accept-encoding"=>"gzip, deflate", "accept-charset"=>"ISO-8859-1,utf-8;q=0.7,*;q=0.7", "accept"=>"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", "user-agent"=>"Mozilla/5.0 (X11; Linux i686; rv:6.0) Gecko/20100101 Firefox/6.0", "host"=>"donpark.org", "if-none-match"=>"\"002d599e5771c81b106c9207b5f33e91\"", "cookie"=>"__utma=100555531.1658899755.1308246960.1314033338.1314036638.94; __utmz=100555531.1314036638.94.78.utmcsr=epdx.org|utmccn=(referral)|utmcmd=referral|utmcct=/people/31; owa_v=cdh%3D%3E3ab5a930%7C%7C%7Cvid%3D%3E-200883154%7C%7C%7Cfsts%3D%3E1308330152%7C%7C%7Cnps%3D%3E22; owa_s=cdh%3D%3E3ab5a930%7C%7C%7Clast_req%3D%3E1314038685%7C%7C%7Csid%3D%3E-1311537598; typo_user_profile=admin; __utmc=100555531; __utmb=100555531.8.10.1314036638; _typo_blog_session=BAh7B0kiD3Nlc3Npb25faWQGOgZFRiIlN2YyOWFlNGZlNmM5MTBlYzc |
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 | |
server { | |
location / { | |
index index.php index.html; | |
rewrite ^/wiki/_media/(.*) /wiki/lib/exe/fetch.php?media=$1 last; | |
rewrite ^/wiki/_detail/(.*) /wiki/lib/exe/detail.php?media=$1 last; | |
rewrite ^/wiki/_export/([^/]+)/(.*) /wiki/doku.php?do=export_$1&id=$2 last; | |
rewrite ^/wiki/lib/tpl/(.*) /wiki/lib/tpl/$1 break; | |
rewrite ^/wiki(/(.*))? /wiki/doku.php?id=$1 last; | |
} |
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
donp@sirius /var/www/donpark.org/typo-git $ bundle install | |
Fetching source index for http://rubygems.org/ | |
You have requested: | |
rake >= 0.9.2 | |
The bundle currently has rake locked at 0.8.7. | |
Try running `bundle update rake` | |
donp@sirius /var/www/donpark.org/typo-git $ bundle update rake | |
Fetching source index for http://rubygems.org/ | |
Bundler could not find compatible versions for gem "actionpack": |
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
## Both a staged and an unstaged change | |
donp@sparky:~/code/lockerproject/Locker$ gs | |
# On branch master | |
# Changes to be committed: | |
# (use "git reset HEAD <file>..." to unstage) | |
# | |
# modified: Config/config.json.example | |
# | |
# Changes not staged for commit: | |
# (use "git add <file>..." to update what will be committed) |
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 'tweetstream' | |
require 'json' | |
require 'irc-socket' | |
SETTINGS = JSON.load(File.open("settings.json")) | |
@irc = IRCSocket.new(SETTINGS["server"]) | |
@irc.connect | |
@irc.nick SETTINGS["nick"] | |
@irc.user SETTINGS["nick"], 0, "*", "Neuron Bot" | |
@irc.join("#pdxtwitter") |
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
# I did a | |
laptop$ git push everyonedelivers.com:/var/www/everyonedelivers.com/rails/.git master | |
[worked fine] | |
problem is, the commits are showing up under "Changes to be committed", | |
but i already committed them on the laptop. what do i do now? | |
server$ git status | |
# On branch master | |
# Changes to be committed: |
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
donp@sparky:~/code/maglev/bin$ ./maglev-irb | |
irb(main):001:0> Maglev::PERSISTENT_ROOT[:demo] = "Message from maglev-irb #1" | |
=> "Message from maglev-irb #1" | |
irb(main):002:0> Maglev.commit_transaction | |
=> true | |
irb(main):003:0> Maglev::PERSISTENT_ROOT[:demo] | |
=> "Message from maglev-irb #1" | |
irb(main):004:0> | |
irb(main):005:0* quit |
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 net = require('net') | |
var server = new net.Server() | |
server.listen(2020) | |
server.on('listening', function() {console.log('listening')}) | |
server.on('connection', function(socket) {console.log('connected '+socket)}) | |
server.on('close', function() {console.log('closed')}) | |
## | |
$ node server.js | |
listening |
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
server.on('connection', function(socket) { | |
var client_id = clients.push(socket) | |
console.log('connected. '+clients.length+' clients. '+clients); | |
socket.on('data', go) | |
socket.on('close', function() { | |
clients.splice(client_id-1,1) | |
console.log('closed. client list '+clients) | |
}) | |
}) |
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
## stream-read.rb | |
require 'gtfs-realtime.pb' | |
require 'eventmachine' | |
require 'em-http-request' | |
trimet = YAML.load(File.open('trimet.yaml')) | |
EventMachine.run do | |
http = EventMachine::HttpRequest.new('http://developer.trimet.org/ws/V1/FeedSpecAlerts/').get(:query => trimet) |