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
#!/usr/bin/env ruby | |
# Made by Pieter de Bie <[email protected]> | |
# Based on a "Pastie" task by someone | |
require "tempfile" | |
GIST_URL = 'http://gist.github.com/gists' | |
GIST_LOGIN_URL = 'https://gist.github.com/session' | |
USERNAME = "martinisoft" | |
TOKEN = "6ef8395fecf207165f1a82178ae1b984" |
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 <sys/types.h> | |
#include <dirent.h> | |
#include <errno.h> | |
#include <vector> | |
#include <string> | |
#include <iostream> | |
using namespace std; | |
// getdir - returns vector of files in all directories of directory |
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
kicker -e "osascript -e 'tell application \"Safari\" to do JavaScript \"window.location.reload();\" in first document'" index.html |
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 "pty" | |
require "expect" | |
STDOUT.sync = true | |
STDERR.sync = true | |
$expect_verbose = true | |
prompt_pat = %r/^[\s]{1}/ | |
PTY.spawn("/home/martinisoft/srcds/orangebox/srcds_run -game tf +ip 192.168.1.8 +maxplayers 8 +map ctf_2fort") do |output, input, pid| | |
input.sync = true |
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 'eventmachine' | |
module EventMachine | |
module Protocols | |
class SRCDS < Connection | |
include EventMachine::Deferrable | |
def initialize | |
@authed = false | |
@commands = { "exec" => 2, "auth" => 3 } |
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
# Rails 3 jQuery Install Rakefile | |
# by Aaron Kalin | |
# Compiled from http://www.railsinside.com/tips/451-howto-unobtrusive-javascript-with-rails-3.html | |
# | |
# Note: this assumes you use git, if not then use the optional usage | |
# | |
# Usage: rake install_query | |
# | |
# Optional usage: rake install_jquery[nogit] | |
# |
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
## Rails App Template | |
## Updated for Rails 3.0.1 | |
## Created on 10/23/10 | |
## Updated on 11/4/10 | |
## Run using $ rails new [appname] -JT -m tpl-cukeapp.rb | |
## Gems | |
# Warden and Devise for security | |
gem 'warden', '0.10.7' |
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
run("echo group :test, :development do >> Gemfile;") | |
run("echo gem \\'rspec-rails\\', \\'\\>\\= 2.3.0\\' >> Gemfile;") | |
run("echo gem \\'capybara\\', \\'0.3.9\\' >> Gemfile;") | |
run("echo gem \\'database_cleaner\\' >> Gemfile;") | |
run("echo gem \\'cucumber-rails\\' >> Gemfile;") | |
run("echo gem \\'launchy\\' >> Gemfile;") | |
run("echo end >> Gemfile;") | |
run("bundle install") |
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
- any character you use it will literally match it except special characters | |
^ $ ? . / \ [ ] { } ( ) + * - all the special characters that will need escaping if you don't want them to be special | |
// - regexp ruby class | |
Common Patterns (I authored) | |
/[\w+\.~-]+@[\w~-]+.[\w\.]+/ - match emails, conforms to RFC 3986 section 3.3 | |
/\+?(\d)?[-|\.|\s]?\(?(\d{3})\)?[-|\.|\s]?(\d{3})[-|\.|\s]?(\d{4})/ - match phone numbers, https://gist.github.com/1009331 | |
Strategies |
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
gort:~ martinisoft$ rvm install -n 1.9 rbx -- --default-version=1.9rbx-head-1.9 installing #dependencies Pulling from origin master | |
Copying from repo to source... | |
rbx-head-1.9 - #configuring | |
rbx-head-1.9 - #compiling | |
rbx-head-1.9 - adjusting #shebangs for (erb ri rdoc). | |
rbx-head-1.9 - #importing default gemsets (/Users/martinisoft/.rvm/gemsets/) | |
WARN: rbx rbx-1.9-head-1.9 is not installed. | |
To install do: 'rvm install rbx-1.9-head-1.9' | |
gort:~ martinisoft$ rvm list |
OlderNewer