Skip to content

Instantly share code, notes, and snippets.

@woods
woods / git_svn_bash_prompt.sh
Created December 4, 2008 15:37 — forked from halbtuerke/gist:31934
Set color bash prompt according to git/svn branch, and return status of last command.
#!/bin/bash
#
# DESCRIPTION:
#
# Set the bash prompt according to:
# * the branch/status of the current git repository
# * the branch of the current subversion repository
# * the return value of the previous command
#
# USAGE:
@tkersey
tkersey / Undo a commit and redo
Created October 8, 2010 22:36
Git: undo a commit and redo
http://stackoverflow.com/questions/927358/git-undo-last-commit
Undo a commit and redo
$ git commit ...
$ git reset --soft HEAD^ (1)
$ edit (2)
$ git commit -a -c ORIG_HEAD (3)
This is most often done when you remembered what you just committed is incomplete, or you misspelled your commit message, or both. Leaves working tree as it was before "reset".
@alex-ethier
alex-ethier / createCallback.m
Created October 11, 2011 04:56
SimpleGeo.framework - IOS
SGCallback *callback = [SGCallback callbackWithSuccessBlock:
^(id response)
{
NSLog(@"Handle Success");
} failureBlock:^(NSError *error)
{
NSLog(@"Handle Failure");
}];
@phpdude
phpdude / nginx.conf
Last active February 28, 2024 04:36
Nginx image filter + caching of results.
location /resize {
alias /tmp/nginx/resize;
set $width 150;
set $height 100;
set $dimens "";
if ($uri ~* "^/resize_(\d+)x(\d+)/(.*)" ) {
set $width $1;
set $height $2;
set $image_path $3;
@swinton
swinton / upstart_virtualenv_test.conf
Created March 5, 2012 15:44
Example of an upstart job running a python script under a virtualenv
########################################
##### upstart_virtualenv_test.conf #####
##### install in /etc/init #####
########################################
description "Testing virtualenv and upstart setup"
env PYTHON_HOME=/home/steve/.virtualenvs/upstart-test
start on runlevel [2345]
@langalex
langalex / backup.rb
Created August 23, 2012 14:13
Couchbase EBS RAID Backup on Scalarium
#!/usr/bin/env ruby
# Backs up the mounted EBS RAID storage used by Couchbase of an EC2 instance using the Scalarium API.
#
# Before running the snapshot it stops Couchbase disk writes and then freezes the file system.
# File system must be XFS.
#
# Usage: Backup.new(<scalarium api token>, <mount point for ebs raid>, <name of couchbase bucket to back up>).start (must be run on the EC2 instance).
require 'rest_client'
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active June 16, 2024 10:16
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@danawoodman
danawoodman / 1-react-websockets-reflux.md
Last active September 15, 2021 14:48
Using WebSockets with Reflux and React

WebSockets + Reflux + React

Using WebSockets, React and Reflux together can be a beautiful thing, but the intial setup can be a bit of a pain. The below examples attempt to offer one (arguably enjoyable) way to use these tools together.

Overview

This trifect works well if you think of things like so:

  1. Reflux Store: The store fetches, updates and persists data. A store can be a list of items or a single item. Most of the times you reach for this.state in react should instead live within stores. Stores can listen to other stores as well as to events being fired.
  2. Reflux Actions: Actions are triggered by components when the component wants to change the state of the store. A store listens to actions and can listen to more than one set of actions.
@juliandunn
juliandunn / evolving-from-founder-to-great-ceo.md
Last active January 2, 2024 15:41
Talk at SXSWi by Joel Trammell.

Evolving from founder to great CEO

Joel Trammell, ex-CEO of NetQOS

theamericanceo.com

CEO: command, management, leadership

  • management is power granted by your position
  • leadership is power granted freely because of a follower’s perception of your credibility, competence and caring.
@juliandunn
juliandunn / what-has-eric-ries-learned-since-2011.md
Last active August 29, 2015 14:17
What Has Eric Ries Learned Since 2011?

What Has Eric Ries Learned Since 2011?

Interview at SXSW Interactive 2015. Interviewer: Ted Greenwald from the Wall Street Journal.

Can you summarize the Lean Startup for those who aren't familiar

  • No rigorous, longitudinal study to determine whether Lean Startup is true or not, but he’s hoping there will be.
  • A startup is just anything new being created under conditions of extreme uncertainty.
  • Use science and not astrology to figure out what’s supposed to happen. That's what is in the book.
  • A pivot is just a change in strategy w/o a change in vision.