Skip to content

Instantly share code, notes, and snippets.

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

Jason Clark jjasonclark

🏠
Working from home
View GitHub Profile
@jsocol
jsocol / sockolepsy.js
Created March 16, 2011 01:20
slow TCP proxy
/**
* Usage: node sockolepsy.js <listen> <forward> <delay>
*
* Creates a generic TCP proxy that can introduce a controllable degree of
* delay per packet.
*
* Params:
* listen - the port to listen on.
* forward - the port to foward to.
* delay - the amount of delay to introduce, in ms.
@jpr5
jpr5 / bot.rb
Created April 26, 2011 07:13
XMPP/Ruby Bot for HipChat
#!/usr/bin/env ruby
#
# Script: HipChat bot in Ruby
# Author: Jordan Ritter <jpr5@darkridge.com>
#
unless `rvm-prompt i g`.chomp == "ree@xmpp"
exec("rvm ree@xmpp ruby #{$0}")
end
@jstorimer
jstorimer / tclient.rb
Created June 25, 2013 21:09
These scripts were the result of the "Faster Rails test runs...with Unix!" screencast at https://www.youtube.com/watch?v=RSehcT4MnRM.
#!/usr/bin/env ruby
require 'socket'
test_file = ARGV[0]
socket = UNIXSocket.new('testing.sock')
socket.write(test_file)
socket.close_write
@keccers
keccers / fizzbuzz.rb
Created August 1, 2013 03:35
OO Ruby FizzBuzz
class FizzBuzz
attr_reader :limit, :sequence
def initialize(limit)
@limit = limit
@sequence = []
end
def display
@CMCDragonkai
CMCDragonkai / angularjs_directive_attribute_explanation.md
Last active November 29, 2023 15:35
JS: AngularJS Directive Attribute Binding Explanation

AngularJS Directive Attribute Binding Explanation

When using directives, you often need to pass parameters to the directive. This can be done in several ways. The first 3 can be used whether scope is true or false. This is still a WIP, so validate for yourself.

  1. Raw Attribute Strings

    <div my-directive="some string" another-param="another string"></div>
;; Set the starting position and width and height of Emacs Window
(add-to-list 'default-frame-alist '(left . 0))
(add-to-list 'default-frame-alist '(top . 0))
(add-to-list 'default-frame-alist '(height . 45))
(add-to-list 'default-frame-alist '(width . 175))
;; To get rid of Weird color escape sequences in Emacs.
;; Instruct Emacs to use emacs term-info not system term info
;; http://stackoverflow.com/questions/8918910/weird-character-zsh-in-emacs-terminal
(setq system-uses-terminfo nil)
(source "melpa" "http://melpa.milkbox.net/packages/")
(source "gnu" "http://elpa.gnu.org/packages/")
(source "marmalade" "http://marmalade-repo.org/packages/")
(depends-on "ac-js2")
(depends-on "adaptive-wrap")
(depends-on "ag")
(depends-on "auto-complete")
(depends-on "calfw")
(depends-on "cask")
@lodestone
lodestone / install-macvim-with-lua.sh
Created January 25, 2014 09:17
brew install macvim with lua
brew install macvim --with-cscope --with-lua --override-system-vim
@proubits
proubits / rubymine-set-spork
Last active April 21, 2016 00:19
Make RubyMine to run rspec/cucumber with Spork DRb Server
==Make RubyMine to run rspec/cucumber with Spork DRb Server
I was testing RubyMine 6.3 and encountered a problem when running spec file with Spork DRb Server running at the background. The Rspec test failed with the following error message:
no such file to load -- teamcity/spec/runner/formatter/teamcity/formatter (LoadError)
RubyMine can run the spec without problem if there's no DRb running.
I spent a lot of time researching the topic to fix it and couldn't find an exact solution for the problem. However from the online resources I was able to come out with a way to fix the problem. Basically, you need to tell RubyMine to run spork with load path for the formatter.
In RubyMine you can set the Run options for Spork. For RubyMine 6.3, go to menu <b>Run</b>...<b>Edit Configurations</b>..., select <b>Defaults</b>...<b>Spork DRb</b>. Now on the <i>Environment variables</i> add this "<tt>RUBYMINE_HOME=/path/to/your-ruby-mine/</tt>"(ignore the double quote), and on the <i>Ruby arguments</i>, append this to th
@vamdt
vamdt / city.rb
Last active July 26, 2022 05:01 — forked from sumskyi/README.md
rails4 sti, custom "type" column name and value
class City < GeoEntity
def self.sti_name
3
end
end