This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Favicon and Apple Touch Icon Generator | |
# | |
# This bash script takes an image as a parameter, and uses ImageMagick to convert it to several | |
# other formats used on modern websites. The following copies are generated: | |
# | |
# * apple-touch-icon-114x114-precomposed.png | |
# * apple-touch-icon-57x57-precomposed.png | |
# * apple-touch-icon-72x72-precomposed.png |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#disable dashboard | |
defaults write com.apple.dashboard mcx-disabled -boolean YES | |
# must restart dock before it takes effect | |
killall dock |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Image | |
import math | |
def hsv_to_rgb(h, s, v): | |
if s * v == 0: | |
r, g, b = v, v, v | |
else: | |
hi = int(math.floor(3 * h / math.pi)) % 6 | |
f = 3 * h / math.pi - hi; | |
p = v * (1.0 - s) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from werkzeug.debug.tbtools import Traceback | |
from phomp.api.errors import PhompException | |
def wrap_exceptional(f): | |
config = 'default_settings' | |
def wrap(f): | |
def wrapper(*args, **kwargs): | |
try: | |
return f(*args, **kwargs) | |
except Exception: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright 2008 Google Inc. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from google.appengine.ext.ndb import model, context, tasklets | |
from random import choice | |
import string | |
from werkzeug import Response | |
class Items(model.Model): | |
user = model.StringProperty() | |
@classmethod | |
@tasklets.tasklet |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import webapp2 | |
import decimal | |
import logging | |
import random | |
import string | |
from google.appengine.api import datastore_errors | |
from google.appengine.datastore import entity_pb | |
from google.appengine.ext import db |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// {{compare unicorns ponies operator="<"}} | |
// I knew it, unicorns are just low-quality ponies! | |
// {{/compare}} | |
// | |
// (defaults to == if operator omitted) | |
// | |
// {{equal unicorns ponies }} | |
// That's amazing, unicorns are actually undercover ponies | |
// {{/equal}} | |
// (from http://doginthehat.com.au/2012/02/comparison-block-helper-for-handlebars-templates/) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import with_statement | |
from fabric.api import env | |
from fabric.api import * | |
from fabric.contrib.console import confirm | |
from fabric.contrib.project import upload_project | |
import ubuntu | |
import protobuf | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#on branch with your commit that you need to split up | |
git checkout -b new_branch_name | |
git log -n1 | |
#now record the sha hash of the last commit, lets call it SHA | |
#make sure you're on a new branch and you have no working directory changes | |
#this next command will wipe out everything and reset you to the previous commit | |
git reset --hard HEAD^ | |
git cherry-pick SHA --no-commit | |
git add /filename/you/_want_/to/pull/request | |
git commit |