Skip to content

Instantly share code, notes, and snippets.

View martinisoft's full-sized avatar
🍎
Makin' Cider & Writing Code

Aaron Kalin martinisoft

🍎
Makin' Cider & Writing Code
View GitHub Profile
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
@martinisoft
martinisoft / kick_safari.sh
Created November 12, 2009 05:47
kick Safari when you edit html files for instant previews
kicker -e "osascript -e 'tell application \"Safari\" to do JavaScript \"window.location.reload();\" in first document'" index.html
@martinisoft
martinisoft / main.cpp
Created June 8, 2009 04:58
List files in directory recursively
#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
@martinisoft
martinisoft / gistie.rb
Created September 23, 2008 06:29 — forked from pieter/gistie.rb
command-line posting to gist
#!/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"