Skip to content

Instantly share code, notes, and snippets.

View cdollins's full-sized avatar
🏠
Working from home

Chad Dollins cdollins

🏠
Working from home
  • Twitter
  • Austin, TX, USA
  • 07:37 (UTC -06:00)
  • X @vipaca
View GitHub Profile
@cdollins
cdollins / rakefile
Created September 5, 2008 19:52 — forked from bryanl/score_test.rb
Greed Game
see => http://github.com/cdollins/tdd_greed/tree/master
f = File.open("/mnt/workspace/Sep19-235956/console.log", 'a+')
Errno::EACCES: Permission denied - /mnt/workspace/Sep19-235956/console.log
from (irb):1:in `initialize'
from (irb):1:in `open'
from (irb):1
desc "Flog Source"
task :flog do
IO.popen("find lib -name \\*.rb | xargs flog").each {|line| puts line }
end
# This is a simple command line tool for uploading
# and folders of files to AWS S3. You must first
# create a vaild bucket to upload to.
#!/usr/bin/env ruby
require 'rubygems'
require 'pathname'
require 'aws/s3'
include AWS::S3
class Quick
def self.sort(array)
return array if array.size < 2
lesser = []
greater = []
pivot = array.pop
array.each do |x|
x <= pivot ? lesser << x : greater << x
end
self.sort(lesser) + [pivot]+ self.sort(greater)
info it worked if it ends with ok
verbose cli [ 'node',
verbose cli '/usr/local/bin/npm',
verbose cli 'install',
verbose cli 'persistencejs-0.2.5',
verbose cli '-g' ]
info using [email protected]
info using [email protected]
verbose config file /root/.npmrc
verbose config file /usr/local/etc/npmrc
app.post('/config', function(req, res) {
console.log('Received Config Push');
//Get Client Name
var name = req.header('X-Forwarded-For');
console.log('Destined for '+ name);
// Get message from POST
req.on('data', function(raw) {
console.log("Data train is here: " + raw);
//Send to NSA
app.post('/config', function(req, res) {
console.log('Received Config Push');
//Get Client Name
var name = req.header('X-Forwarded-For');
console.log('Destined for '+ name);
// Get message from POST
req.on('data', function(raw) {
console.log("Data train is here: " + raw);
//Send to NSA
@cdollins
cdollins / chroot_copier.sh
Created March 4, 2012 23:08
setup for chroot
#!/usr/bin/env bash
chroot=$1
command=`which $2`
ldd $command | while read line; do
if [[ `echo $line | awk '{print $3}'` =~ ^/ ]] ; then
sso=`echo $line | awk '{print $3}'`
lib_path=`dirname $sso`
name=`basename $sso`
@cdollins
cdollins / super.rb
Last active December 30, 2015 08:09
Super!
class A
def initialize
p "Hello"
end
end
class B < A
def initialize
p "Fellow"
end