Skip to content

Instantly share code, notes, and snippets.

View russomi's full-sized avatar
☁️
Remote

Michael Russo russomi

☁️
Remote
View GitHub Profile
git rm --cached -r .
git reset --hard
git add .
git commit -m "Normalize line endings"
import webapp2
from twilio import twiml
from twilio.rest import TwilioRestClient
class SendSMS(webapp2.RequestHandler):
def get(self):
# replace with your credentials from: https://www.twilio.com/user/account
account_sid = "ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
auth_token = "xxxxxxxxxxxxxxxxxxxxxxxxxx"
client = TwilioRestClient(account_sid, auth_token)
@russomi
russomi / gitlog2changelog.py
Last active December 25, 2015 09:08
Git and Automatic ChangeLog generation
#!/usr/bin/python
# Copyright 2008 Marcus D. Hanwell <marcus@cryos.org>
# Distributed under the terms of the GNU General Public License v2 or later
import string, re, os
git_cmd = 'git log --summary --stat --no-merges --date=short'
# Execute git log with the desired command line options.
fin = os.popen(git_cmd, 'r')
@russomi
russomi / log-json-gitconfig.ini
Created October 13, 2013 16:01
git alias to output git log as json
#Add this to your .gitConfig file in your .git folder
#To to execute type at git bash: git log-json > ChangeLog.json
#It will save the output to a file named ChangeLog.json
#You can use this file to create your own pretty version of the ChangeLog
[alias]
log-json = !git log --pretty=format:'\"%h\": {%n \"commit\": \"%H\",%n \"author\": \"%an <%ae>\",%n \"date\": \"%ai\",%n \"message\": \"%s\"%n},'

a simple git branching model

This is a very simple git workflow. It (and variants) is in use by many people. I settled on it after using it very effectively at Athena. GitHub does something similar; Zach Holman mentioned it in this talk.

Update: Woah, thanks for all the attention. Didn't expect this simple rant to get popular.

find . -type d -empty -not -path "./.git/*" -exec touch {}/.gitkeep \;
[alias]
# http://haacked.com/archive/2014/07/28/github-flow-aliases/
co = checkout
ec = config --global -e
up = !git pull --rebase --prune $@ && git submodule update --init --recursive
cob = checkout -b
cm = !git add -A && git commit -m
save = !git add -A && git commit -m 'SAVEPOINT'
wip = !git add -u && git commit -m "WIP"
undo = reset HEAD~1 --mixed
@russomi
russomi / README-Template.md
Created March 14, 2016 22:44 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisities

@russomi
russomi / flask_server.py
Created July 11, 2016 16:49 — forked from tschieggm/flask_server.py
Stackdriver webhook server example
import string
import sys
import logging
import json
from flask import Flask
from flask import Response, request
logger = logging.getLogger(__name__)
logger.info("Stackdriver webhook-sample starting up on %s" % (string.replace(sys.version, '\n', ' ')))
#!/usr/bin/env bash
# Shell prompt based on the Solarized Dark theme.
# Screenshot: http://i.imgur.com/EkEtphC.png
# Heavily inspired by @necolas’s prompt: https://github.com/necolas/dotfiles
# iTerm → Profiles → Text → use 13pt Monaco with 1.1 vertical spacing.
if [[ $COLORTERM = gnome-* && $TERM = xterm ]] && infocmp gnome-256color >/dev/null 2>&1; then
export TERM='gnome-256color';
elif infocmp xterm-256color >/dev/null 2>&1; then