Skip to content

Instantly share code, notes, and snippets.

View dmmfll's full-sized avatar

Don Morehouse dmmfll

  • Fort Lauderdale, Florida
View GitHub Profile
@zachwaugh
zachwaugh / gist:521133
Created August 12, 2010 15:19
Loading rails environment in a script
#!/usr/bin/env ruby
# Load Rails
ENV['RAILS_ENV'] = ARGV[0] || 'production'
DIR = File.dirname(__FILE__)
require DIR + '/../config/environment'
# ... do stuff that requires using your rails models
@marianoguerra
marianoguerra / table2rst.py
Created August 10, 2011 16:14
csv table 2 rst
'''read a csv file representing a table and write a restructured text simple
table'''
import sys
import csv
def get_out(out=None):
'''
return a file like object from different kinds of values
None: returns stdout
string: returns open(path)
@cjoudrey
cjoudrey / twitter.js
Created November 5, 2011 16:37
Lazy-rendering in PhantomJS
// This example shows how to render pages that perform AJAX calls
// upon page load.
//
// Instead of waiting a fixed amount of time before doing the render,
// we are keeping track of every resource that is loaded.
//
// Once all resources are loaded, we wait a small amount of time
// (resourceWait) in case these resources load other resources.
//
// The page is rendered after a maximum amount of time (maxRenderTime)
@hrldcpr
hrldcpr / tree.md
Last active May 1, 2024 00:11
one-line tree in python

One-line Tree in Python

Using Python's built-in defaultdict we can easily define a tree data structure:

def tree(): return defaultdict(tree)

That's it!

@carlosmcevilly
carlosmcevilly / gist:2221249
Created March 27, 2012 22:55
fix git commit with wrong email address in git config, before pushing
If:
- you add and commit with the wrong email address in git, and
- your remote has a hook set up to prevent you from pushing with the bad address
Then you need to amend the author of your commit before push can succeed:
1. fix your email address in git config:
$ git config user.name "Your Name"
@fperez
fperez / ProgrammaticNotebook.ipynb
Last active May 2, 2024 19:14
Creating an IPython Notebook programatically
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@maxim
maxim / tasks.yml
Last active June 15, 2016 03:41
Copy file on remote machine in ansible
- name: ensure file exists at path
shell: rsync -ci /source/path /destination/path
register: rsync_result
changed_when: "rsync_result.stdout != ''"
@evanscottgray
evanscottgray / wow_bounce.md
Last active November 8, 2017 13:47
Getting UDP out from behind a restrictive firewall.

Mosh + OpenVPN = Love

Okay. Let's pretend here for a sec that you work in an office where UDP is filtered outbound, but we really want to use UDP for mosh.

Here's the plan at a high level.

  1. Spin up a cloud server
  2. Install Docker
  3. Start OpenVPN Container
  4. Grab .ovpn config
  5. Modify .ovpn config to a include static route to your UDP-enabled destination
@cdjhlee
cdjhlee / zeromq_install.sh
Last active August 24, 2021 19:37
install zeromq in ubuntu 14.04
#!/usr/bin/bash
##############################################
#from http://zeromq.org/intro:get-the-software
##############################################
#get zeromq
wget http://download.zeromq.org/zeromq-4.0.5.tar.gz
#unpack tarball package
@d2s
d2s / installing-node-with-nvm.md
Last active March 13, 2024 12:09
Installing Node.js to Linux & macOS & WSL with nvm

Installing Node.js with nvm to Linux & macOS & WSL

A quick guide on how to setup Node.js development environment.

Install nvm for managing Node.js versions

nvm allows installing several versions of Node.js to the same system. Sometimes applications require a certain versions of Node.js to work. Having the flexibility of using specific versions can help.

  1. Open new Terminal window.