This file contains 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 | |
protected_branch='master' | |
current_branch=$(git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,') | |
if [ $protected_branch = $current_branch ] | |
then | |
echo 'No pushing to master' | |
exit 1 # commit will not execute | |
else |
This file contains 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
/* | |
* utility variables for escaping HTML | |
*/ | |
// escapeMap, borrowed from underscore.js | |
var escapeMap = { | |
'&': '&', | |
'<': '<', | |
'>': '>', | |
'"': '"', | |
"'": ''', |
This file contains 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
/** | |
* Recursively flattens nested arrays | |
* ex: [[1,2,[3]],4] -> [1,2,3,4] | |
* | |
* @param Array arr | |
* @return Array | |
*/ | |
const flatten = (arr) => ( | |
// reduce will iterate and | |
// add to an array |
This file contains 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 | |
rm latest.tar.gz | |
wget https://wordpress.org/latest.tar.gz | |
tar -xzvf latest.tar.gz | |
if [[ $1 ]]; then | |
mv wordpress $1 | |
cd $1 | |
else |
This file contains 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
''' | |
Given an SVG in the same directory ('./res/' by default), | |
iterates and creates new icons and splashscreens for | |
the PhoneGap Hello World Template | |
''' | |
import sys, os, subprocess | |
from PIL import Image | |
def createImages (logo_file_name = 'logo.svg', bg_color = '#ffffff', logo_name = 'project'): |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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 django.http import HttpResponse, HttpResponseRedirect | |
from django.contrib import admin | |
from django.contrib.auth.admin import UserAdmin | |
def export_to_csv (modeladmin, request, queryset): | |
import csv, StringIO | |
from django.core.servers.basehttp import FileWrapper | |
cols = ['username','email','first_name','last_name'] |
NewerOlder