Skip to content

Instantly share code, notes, and snippets.

View simeonwillbanks's full-sized avatar
☀️
😎

Simeon Willbanks simeonwillbanks

☀️
😎
View GitHub Profile
@simeonwillbanks
simeonwillbanks / setup-centos-server.markdown
Created February 1, 2013 18:24 — forked from weakish/README.md
setup #centos #server #sysadmin #debian

CentOS server setup guide for people from debian

A basic server setup guide for people from debian to CentOS.

Software

yum is apt-get/aptitude on CentOS.

@jch
jch / polling_request.coffee
Created August 16, 2013 22:01
some pseudocode for polling long running jobs
# # PollingRequest
#
# A xhr request that repeatedly polls a [progress-aware endpoint](#progress-aware-endpoint).
#
# req = PollingRequest.new
# url: /states.csv
# interval: 2000 # polling interval in milliseconds
# progress: (n)->
# console.log "Progress: #{n} percent"
# success: (res)->
@EmmanuelOga
EmmanuelOga / callback.rb
Created December 1, 2011 15:54
callback test.
require 'benchmark'
class Proc
def slow_callback(callable, *args)
self === Class.new do
method_name = callable.to_sym
define_method(method_name) { |&block| block.nil? ? true : block.call(*args) }
define_method("#{method_name}?") { true }
def method_missing(method_name, *args, &block) false; end
end.new
@soemarko
soemarko / theme.html
Created November 26, 2011 16:18
embed github gist to tumblr
<!-- Add the following lines to theme's html code right before </head> -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script>
<script src="http://static.tumblr.com/fpifyru/VCxlv9xwi/writecapture.js"></script>
<script src="http://static.tumblr.com/fpifyru/AKFlv9zdu/embedgist.js"></script>
<!--
Usage: just add <div class="gist">[gist URL]</div>
Example: <div class="gist">https://gist.github.com/1395926</div>
-->
@adamsanderson
adamsanderson / test_mail_purge.rb
Created December 18, 2010 04:35
An example of using MiniTest::Mock
require 'minitest/mock'
require 'minitest/unit'
require 'date'
MiniTest::Unit.autorun
class TestMailPurge < MiniTest::Unit::TestCase
class MailPurge
def initialize(imap)
@imap = imap
@ryanb
ryanb / rails_3_1_rc4_changes.md
Created May 6, 2011 01:10
The Changelogs for Rails 3.1 Beta 1

Railties 3.1 RC4

  • The new rake task assets:clean removes precompiled assets. [fxn]

  • Application and plugin generation run bundle install unless --skip-gemfile or --skip-bundle. [fxn]

  • Fixed database tasks for jdbc* adapters #jruby [Rashmi Yadav]

  • Template generation for jdbcpostgresql #jruby [Vishnu Atrai]

@tomdale
tomdale / gist:3981133
Last active November 26, 2019 21:19
Ember.js Router API v2

WARNING

This gist is outdated! For the most up-to-date information, please see http://emberjs.com/guides/routing/!

It All Starts With Templates

An Ember application starts with its main template. Put your header, footer, and any other decorative content in application.handlebars.

<header>
@igrigorik
igrigorik / ruby-1.9-tips.rb
Created February 3, 2011 17:19
Ruby 1.9 features, tips & tricks you may not know about...
def tip(msg); puts; puts msg; puts "-"*100; end
#
# 30 Ruby 1.9 Tips, Tricks & Features:
# http://www.igvita.com/2011/02/03/new-ruby-19-features-tips-tricks/
#
tip "Upgrading to Ruby 1.9 is simple: rvm install 1.9.2 && rvm --default 1.9.2"
tip "Ruby 1.9 supports named captures in regular expressions!"
@danneu
danneu / ruby_koans_151_solution.rb
Created August 4, 2011 22:09
Ruby Koans 151 triangle.rb solution
def triangle(a, b, c)
raise TriangleError if a<=0 or b<=0 or c<=0
raise TriangleError if a+b<=c or b+c<=a or a+c<=b
return :equilateral if a==b and a==c
return :isosceles if a==b or b==c or a==c
:scalene
end
@jordelver
jordelver / gist:5806460
Created June 18, 2013 15:41
Sharing files using netcat

Sharing files using netcat

The receiver

nc -l 5566 > data-dump.sql

Listen on port 5566 and redirect output to data-dump.sql

The sender