Skip to content

Instantly share code, notes, and snippets.

View kusor's full-sized avatar
💭
Positively happy

Pedro Palazón Candel kusor

💭
Positively happy
  • Joyent Inc.
  • Murcia (Spain)
  • X @kusor
View GitHub Profile
@kusor
kusor / vimrc
Created March 3, 2009 19:33 — forked from vmunix/vimrc
" Use Vim settings, rather then Vi settings (much better!).
" This must be first, because it changes other options as a side effect.
set nocompatible
" allow backspacing over everything in insert mode
set backspace=indent,eol,start
set background=dark
set title " set xterm title
set history=1000 " keep 1000 lines of command line history
Here's an example of how I was able to use the rsp from Smart.app to run on a different
port at the same time. It would be nice if this ability was built into the GUI app, but
for now, I hacked it.
I made a directory for my app here:
/Users/jim/joyent/rsp/local-smartasks
I put the application source in a subdirectory called '127.0.0.1'. So the bootstrap.js is
at /Users/jim/joyent/rsp/local-smartasks/127.0.0.1/js/bootstrap.js
begin
require 'minigems'
rescue LoadError
require 'rubygems'
end
if File.directory?(gems_dir = File.join(Dir.pwd, 'gems')) ||
File.directory?(gems_dir = File.join(File.dirname(__FILE__), '..', 'gems'))
$BUNDLE = true; Gem.clear_paths; Gem.path.unshift(gems_dir)
end
begin
require 'minigems'
rescue LoadError
require 'rubygems'
end
if File.directory?(gems_dir = File.join(Dir.pwd, 'gems')) ||
File.directory?(gems_dir = File.join(File.dirname(__FILE__), '..', 'gems'))
$BUNDLE = true; Gem.clear_paths; Gem.path.unshift(gems_dir)
end
# :PUBLISHER: markdown, shell, { command: 'rdiscount' }
# :BRACKET_CODE: '[ruby]', '[/ruby]'
# :TEXT:
#
# Have you ever started a long operation and walked away from the computer, and
# come back half an hour later only to find that the process is hung up waiting
# for some user input? It's a sub-optimal user experience, and in many cases it
# can be avoided by having the program choose a default if the user doesn't
# respond within a certain amount of time. One example of this UI technique in
# the wild is powering off your computer - most modern operating systems will
@kusor
kusor / gist:229816
Created November 9, 2009 09:07 — forked from tmm1/gist:89588
require 'rubygems'
require 'eventmachine'
module ChatClient
def self.list
@list ||= []
end
def post_init
@name = "anonymous_#{rand(99999)}"
commit 7fba8f5e4978b2ff990304f7150918f1cc0eea74
Author: Aman Gupta <aman@tmm1.net>
Date: Fri Mar 27 13:51:30 2009 -0700
dtrace patch for 1.8.7 (run autoconf, then ./configure --disable-pthread --enable-dtrace --prefix=/opt/ruby-dtrace)
diff --git a/Makefile.in b/Makefile.in
index a37bcf6..604bfed 100644
--- a/Makefile.in
+++ b/Makefile.in
@kusor
kusor / cron-test.js
Created December 20, 2009 10:14 — forked from onewland/cron-test.js
simple cron API for node.js
var cron = require('./cron'), sys = require('sys');
cron.Every((2).seconds(), function() { sys.puts('Working!'); });
@kusor
kusor / info.txt
Created March 12, 2010 15:24 — forked from konobi/info.txt
# In .ssh/config:
Host *
ControlMaster no # Connections by default are not a master
ControlPath ~/.ssh/master-%r@%h:%p
ServerAliveInterval 60
ServerAliveCountMax 60
# On normal connections, if there is no master running on the ControlPath it will behave as normal
ssh some.host
@kusor
kusor / no.de.sh
Created October 9, 2010 06:43 — forked from isaacs/no.de.sh
no.de API command line client
#!/bin/bash
SERVER=https://api.no.de
SCRIPT="$0"
if [ ${SCRIPT:0:1} == "/" ]; then
SCRIPT="$(basename -- "$SCRIPT")"
fi
main () {
cmd=${1-help}