This file contains 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/bash | |
# Author: Murilo Santana | |
# Google url shortener bash script | |
# For information about the url shortener app: | |
# http://ggl-shortener.appspot.com/instructions/ | |
app='http://ggl-shortener.appspot.com/?url=' | |
url="$1" | |
protocol=`echo "$1" | sed -e "/^http:\/\//g"` |
This file contains 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
# node.js app under nginx | |
upstream node { | |
server 127.0.0.1:8001; | |
} | |
server { | |
listen 80; | |
server_name node; |
This file contains 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
// setTimeout Looping | |
function loop(fn,time){ | |
setTimeout(fn(),time); | |
loop(fn(),time); | |
} |
This file contains 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 node | |
console.log("output string 'test' encrypted"); | |
var crypto = require('crypto'); | |
function md5(str) { | |
var hash = crypto.createHash('md5'); | |
hash = hash.update(str); | |
hash = hash.digest('hex'); |
This file contains 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 buffer = require('buffer').Buffer; | |
function base64(str) { | |
new buffer(str).toString('base64'); | |
} |
This file contains 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
# simple example with Sinatra | |
require 'rubygems' | |
require 'sinatra' | |
class Example | |
get '/' do | |
haml :index | |
end | |
end |
This file contains 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
mvrilo@ruf-home:~$ ssh -vvv [email protected] | |
OpenSSH_5.3p1 Debian-3ubuntu4, OpenSSL 0.9.8k 25 Mar 2009 | |
debug1: Reading configuration data /etc/ssh/ssh_config | |
debug1: Applying options for * | |
debug2: ssh_connect: needpriv 0 | |
debug1: Connecting to mvrilo.no.de [72.2.126.114] port 22. | |
debug1: Connection established. | |
debug1: identity file /home/mvrilo/.ssh/identity type -1 | |
debug3: Not a RSA1 key file /home/mvrilo/.ssh/id_rsa. | |
debug2: key_type_from_name: unknown key type '-----BEGIN' |
This file contains 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 'eventmachine' | |
class Example < EventMachine::Connection | |
def receive_data data | |
send_data "EventMachine minimal server\n\n-----\n#{data}-----\n#{request(data).inspect}" | |
puts request(data).inspect | |
close_connection_after_writing | |
end |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>html5 javascript canvas</title> | |
</head> | |
<body> | |
<script> | |
var canvas, context, mouse = { x: 0, y: 0 }; | |
function onDocumentMouseDown(event) { |
This file contains 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 'eio/eventmachine' | |
TMPFILE = File.expand_path(File.join(File.dirname(__FILE__), "test")) | |
EM.run do | |
EIO.eventmachine_handler | |
EIO.open(TMPFILE, EIO::RDWR) do |fd| | |
EIO.read(fd) do |buf| | |
data = "#{buf} ok" | |
EIO.write(fd, data) do |data| |
OlderNewer