Skip to content

Instantly share code, notes, and snippets.

;; Installation:
;; Add the following to your emacs setup:
;; (add-to-list 'load-path "<directory-of-this-file>")
;; (add-hook 'inf-ruby-mode-hook (lambda () (require 'inf-ruby-company)))
(require 'company)
(defun inf-ruby-company-backend (command &optional arg &rest ignored)
(case command
('prefix
@bradymiller
bradymiller / mirrorOpenEMR_sf_git
Created October 31, 2010 09:18
Script to mirror the SF git repo to github, gitorious, bitbucket, assembla and google code
#!/bin/bash
#
# Copyright (C) 2010 Brady Miller <[email protected]>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
#
@WaYdotNET
WaYdotNET / align.el
Created November 15, 2010 14:40
Align function emacs
;; Align command !!!
;; from http://stackoverflow.com/questions/3633120/emacs-hotkey-to-align-equal-signs
;; another information: https://gist.github.com/700416
;; use rx function http://www.emacswiki.org/emacs/rx
(defun align-to-colon (begin end)
"Align region to colon (:) signs"
(interactive "r")
@dstrelau
dstrelau / app.rb
Created November 22, 2010 20:36
Gollum protected by HTTP Basic
require 'gollum/frontend/app'
require 'digest/sha1'
class App < Precious::App
User = Struct.new(:name, :email, :password_hash)
before { authenticate! }
helpers do
def authenticate!
#!/bin/zsh
# Copyleft 2010 paradoxxxzero All wrongs reserved
# With contribution from James Ahlborn
# https://gist.github.com/752727
# Fork of https://gist.github.com/586698 by nicoulaj / dingram / roylzuo ...
# From http://www.zsh.org/mla/users/2010/msg00692.html
# Token types styles.
# See http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#SEC135
@mig
mig / init.el
Created January 18, 2011 21:00
Simple Emacs 24 configuration for Rails development
;; emacs configuration
(push "/usr/local/bin" exec-path)
(add-to-list 'load-path "~/.emacs.d")
(setq make-backup-files nil)
(setq auto-save-default nil)
(setq-default tab-width 2)
(setq-default indent-tabs-mode nil)
(setq inhibit-startup-message t)
@lfittl
lfittl / gist:797583
Created January 26, 2011 22:07
Cronjob script for syncing mongrel2 fossil to git
#!/bin/bash
echo "*** STARTING SYNC `date` ***" >> /root/sync.log
/root/fossil/fossil pull -R /root/mongrel2.fossil http://mongrel2.org:44445/ >> /root/sync.log
cd /root/mongrel2
/root/fossil/fossil export -R /root/mongrel2.fossil | git fast-import --quiet >> /root/sync.log
git push --all origin >> /root/sync.log 2>&1
echo "*** FINISHED SYNC `date` ***" >> /root/sync.log
@mikeyk
mikeyk / redis_session_backend.py
Created April 8, 2011 18:01
A redis backend for Django Sessions, tested on Django 1.3+
from django.contrib.sessions.backends.base import SessionBase, CreateError
from django.conf import settings
from django.utils.encoding import force_unicode
import redis
class SessionStore(SessionBase):
""" Redis store for sessions"""
def __init__(self, session_key=None):
self.redis = redis.Redis(
@coordt
coordt / check_for_updates.py
Created April 8, 2011 18:39
Check locally installed packages against one or more package indexes for updates and list them.
#!/usr/bin/env python
"""
Use pip to get a list of local packages to check against one or more package
indexes for updated versions.
"""
import pip
import sys, xmlrpclib
from cStringIO import StringIO
from distutils.version import StrictVersion, LooseVersion
Firefox
|
V
OS X Laptop port 4565 on OS X Linux VM
Nginx on port 80 -------> is forwarded to 80 on ------> Nginx on port 80
the VM |
V
Gunicorn server