Skip to content

Instantly share code, notes, and snippets.

View rondale-sc's full-sized avatar

Jonathan rondale-sc

  • Providence, Rhode Island
View GitHub Profile
@endolith
endolith / Has weird right-to-left characters.txt
Last active April 7, 2024 01:38
Unicode kaomoji smileys emoticons emoji
ּ_בּ
בּ_בּ
טּ_טּ
כּ‗כּ
לּ_לּ
מּ_מּ
סּ_סּ
תּ_תּ
٩(×̯×)۶
٩(̾●̮̮̃̾•̃̾)۶
@pguillory
pguillory / gist:729616
Created December 5, 2010 23:51
Hooking into Node.js stdout
var util = require('util')
function hook_stdout(callback) {
var old_write = process.stdout.write
process.stdout.write = (function(write) {
return function(string, encoding, fd) {
write.apply(process.stdout, arguments)
callback(string, encoding, fd)
}
@gmiroshnykov
gmiroshnykov / spawn_vim.js
Created March 24, 2012 09:54
Spawn a child process and bind it to parent's stdin, stdout and stderr in node.js
var tty = require('tty'),
spawn = require('child_process').spawn;
var child = spawn('vim');
child.stdout.pipe(process.stdout);
child.stderr.pipe(process.stderr);
process.stdin.pipe(child.stdin);
process.stdin.resume();
tty.setRawMode(true);
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@joachimhs
joachimhs / gist:3529609
Created August 30, 2012 14:27
Ember.js rerender on window resize issue
init: function() {
var view = this;
var resizeHandler = function() {
view.rerender();
};
this.set('resizeHandler', resizeHandler);
$(window).bind('resize', this.get('resizeHandler'));
},
@henrik
henrik / rules.md
Last active May 23, 2022 12:31
Sandi Metz' four rules from Ruby Rogues episode 87. Listen or read the transcript: http://rubyrogues.com/087-rr-book-clubpractical-object-oriented-design-in-ruby-with-sandi-metz/
  1. Your class can be no longer than 100 lines of code.
  2. Your methods can be no longer than five lines of code.
  3. You can pass no more than four parameters and you can’t just make it one big hash.
  4. When a call comes into your Rails controller, you can only instantiate one object to do whatever it is that needs to be done. And your view can only know about one instance variable.

You can break these rules if you can talk your pair into agreeing with you.

$ rvm mount -r https://rvm.io/binaries/ubuntu/12.04/i386/ruby-1.9.3-p392.tar.bz2 --verify-downloads 1
https://rvm.io/binaries/ubuntu/12.04/i386/ruby-1.9.3-p392.tar.bz2 - #configure
ruby-1.9.3-p392 - #download
######################################################################## 100.0%
ruby-1.9.3-p392 - #validate archive
ruby-1.9.3-p392 - #extract
ruby-1.9.3-p392 - #validate binary
ruby-1.9.3-p392 - #setup
Saving wrappers to '/home/rdm/.rvm/wrappers/ruby-1.9.3-p392'........
ruby-1.9.3-p392 - #importing default gemsets, this may take time.......................
@rwjblue
rwjblue / steps.md
Last active April 12, 2020 18:07
Remote Pairing (through SSH tunnel) Setup

Start with a machine that is directly accessible to both parties via SSH (linode, EC2, prgmr.com, etc), and that you can add users to. DO NOT USE root!!!!

Usage

##From the hosts local machine:

ssh -R1337:localhost:22 host@<shared server's ip address/hostname>
@pixelhandler
pixelhandler / pre-push.sh
Last active April 8, 2024 01:04
Git pre-push hook to prevent force pushing master branch
#!/bin/sh
# Called by "git push" after it has checked the remote status,
# but before anything has been pushed.
#
# If this script exits with a non-zero status nothing will be pushed.
#
# Steps to install, from the root directory of your repo...
# 1. Copy the file into your repo at `.git/hooks/pre-push`
# 2. Set executable permissions, run `chmod +x .git/hooks/pre-push`
@assafgelber
assafgelber / Rakefile
Last active December 19, 2015 15:38
Rakefile for building haml layouts, includes and indexes for jekyll for use in github pages.
# Rake tasks to parse haml layouts, includes and index files for jekyll
# Assumes that the haml files are in (_layouts|_includes|_posts)/_haml
namespace :haml do
require 'haml'
def convert file, destination
base_name = File.basename(file, '.haml') + '.html'
html = File.open(file, 'r') { |f| Haml::Engine.new(f.read).render }
File.open(File.join(destination, base_name), 'w') { |f| f.write html }