Skip to content

Instantly share code, notes, and snippets.

View mikedory's full-sized avatar

Mike Dory mikedory

View GitHub Profile
@learncodeacademy
learncodeacademy / pubsub.js
Created July 29, 2015 02:54
Basic Javascript PubSub Pattern
//events - a super-basic Javascript (publish subscribe) pattern
var events = {
events: {},
on: function (eventName, fn) {
this.events[eventName] = this.events[eventName] || [];
this.events[eventName].push(fn);
},
off: function(eventName, fn) {
if (this.events[eventName]) {
@chrissimpkins
chrissimpkins / gist:5bf5686bae86b8129bee
Last active June 19, 2024 18:05
Atom Editor Cheat Sheet: macOS

Use these rapid keyboard shortcuts to control the GitHub Atom text editor on macOS.

Key to the Keys

  • ⌘ : Command key
  • ⌃ : Control key
  • ⌫ : Delete key
  • ← : Left arrow key
  • → : Right arrow key
  • ↑ : Up arrow key
@zunayed
zunayed / gist:fcff48a276c28f9839d2
Last active August 29, 2015 14:06
Watching variables while debugging for prestige projects

I finally took Josh's advice and started digging deeper into Pycharms visual debugger. But I quickly ran into an issue using envdir for our prestige projects. There doesn't seem like there is a way to prepend the django manage.py command with envdir. So I modified the manage.py file with these few lines to load your envdir/ folder. The added benefit of this is you can just type python /manage.py runserver. Otherwise you would have to manually enter all the required Enviromental variables into pycharm by hand and also track the changes. I figured I share this.

if 'local' in sys.argv:
    env_dir = os.path.join('local', 'envdir')
else:
    env_dir = 'envdir/dev'
@sleepygarden
sleepygarden / supermoji.py
Last active August 29, 2015 14:01
Supermoji - make your Hipchat emojis super!
# all forms must be the same height. each line in a form must be the same width, but each form's width may differ. blank lines are permitted at the top and bottom of each form.
A = """
XXXX
X X
XXXX
X X
X X
"""
B = """
XXX
@sleepygarden
sleepygarden / finger.py
Last active December 24, 2015 01:29
the finger, she flips
# -*- coding: utf-8 -*-
"""
useage: import finger
finger.flip()
"""
finger = """
/´¯/)
,/¯ /
/ /
/´¯/' '/´¯¯`·¸
@iansheridan
iansheridan / save_fingers.sh
Created September 12, 2013 22:30
pre-populate known_hosts file for known ssh access points such as github.com
# HOST == access URI (eg. github.com)
ssh-keyscan -t rsa,dsa HOST 2>&1 | sort -u - ~/.ssh/known_hosts > ~/.ssh/tmp_hosts
cat ~/.ssh/tmp_hosts >> ~/.ssh/known_hosts
@netpoetica
netpoetica / Setting up Nginx on Your Local System.md
Last active November 13, 2024 17:24
Setting up Nginx on Your Local System

#Setting up Nginx on Your Local System ###by Keith Rosenberg

##Step 1 - Homebrew The first thing to do, if you're on a Mac, is to install homebrew from http://mxcl.github.io/homebrew/

The command to type into terminal to install homebrew is:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
@olexpono
olexpono / Custom.css
Last active February 14, 2023 15:44
Crate -- a Dark gray/orange Theme for Chrome DevTools
/**********************************************/
/*
/*
/* Crate -- Theme for Chrome DevTools
/* Last Update :: September 2013
/*
/* based on:
/* mnml by Michael P. Pfeiffer
/* Based on a Gist by Ben Truyman. Further attr:
/* https://gist.github.com/3040634
@aubricus
aubricus / __init__.py
Last active November 27, 2022 01:19 — forked from yuvadm/fabfile.py
Using Fabric to connect to the remote server via an ssh config.
from fabric.api import env
env.use_ssh_config = True
env.forward_agent = True
env.roledefs = {
# key # hostname from config
'foo': ['foo.production'],
}