Want to fork your own gists? No fork button? No problem! Install this user script by clicking refork.user.js' "raw" link down below: ⇓
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
function parse_git_branch { | |
local DIRTY="" | |
git diff --quiet HEAD &>/dev/null | |
case $? in | |
129) | |
# not a git repo, don't waste a second git command | |
return $? | |
;; | |
1) | |
DIRTY="⚡" |
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
(function(jQuery) { | |
// adapted from the work of Chris Beaven https://gist.github.com/967775 | |
jQuery.fn.selectOptgroup = function(options) { | |
var settings = jQuery.extend({ | |
optSelect: '_options', | |
inBetween: '', | |
optBlank: null, | |
selectBlank: null, | |
keepOrphans: true, | |
showSpeed: 200 |
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
# Launch screen/tmux. Start this in the background while you try your other fixes. See which works first. | |
# Skip this if you want to try to fix your current venv | |
create_environment; sv; load_prod_db; django-admin.py loaddata local_site_list | |
# In case your jellydoughnut wasn't totally up to date | |
ensure_ro_db_user | |
# Migration Whack-a-Mole | |
django-admin.py migrate sitesettings |
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
[ | |
{ | |
"Top News": { | |
"feeds": [ | |
"/api/content/v1/manuallist/5847/?format=json", | |
"/api/content/v1/automaticlist/9121/?format=json" | |
] | |
} | |
}, | |
{ |
This is a script that adds a fully functional Fork button to your own Gist.
If a Fork button is already present in the page, this bookmarklet will set focus to it instead of adding another one.
The change is temporary and the button will disappear as soon as you navigate away from that Gist (clicking the Fork button does this for you as well). Meaning you will have to run the script every new page load.
Copy the contents from bookmarklet.js, open Scracthpad (Ctrl+F4), paste it there. Back in browser, swwitch to tab with your Gist you want to fork. Back in Scratchpad, "Run" it. Save and/or bookmark the Scratchpad file for future use.
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
#!/usr/bin/env bash | |
# | |
# Example of multiple key AES encryption for text files using the openssl v. 0.9.8+ command line utility | |
# Uses n public certs as key for MIME PKCS envelope, any individual private key can decrypt. | |
# | |
# If standard RSA ssh keys exist, these can be converted to public certs as well (and ssh keys can decrypt) | |
# | |
# To sign (and verify) the encrypted file, one of the private keys is required, see: | |
# http://www.openssl.org/docs/apps/smime.html#EXAMPLES for openssl smime examples | |
# or http://www.openssl.org/docs/apps/cms.html#EXAMPLES for cms utility (OpenSSL v. 1.0+) |
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
var mgo = new Mongo() | |
function getReadableFileSizeString(fileSizeInBytes) { | |
var i = -1; | |
var byteUnits = [' kB', ' MB', ' GB', ' TB', 'PB', 'EB', 'ZB', 'YB']; | |
do { | |
fileSizeInBytes = fileSizeInBytes / 1024; | |
i++; | |
} while (fileSizeInBytes > 1024); |
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
// Photoshop Script to Create iPhone Icons from iTunesArtwork | |
// Original: https://gist.github.com/appsbynight/3681050 | |
// Turn debugger on. 0 is off. | |
// $.level = 1; | |
try | |
{ | |
// Prompt user to select iTunesArtwork file. Clicking "Cancel" returns null. | |
var iTunesArtwork = File.openDialog("Select a sqaure PNG file that is at least 1024x1024.", "*.png", false); |
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/sh | |
set -e | |
HOST=localhost | |
DB=test-entd-products | |
COL=asimproducts | |
S3PATH="s3://mongodb-backups-test1-entd/$DB/$COL/" | |
S3BACKUP=$S3PATH`date +"%Y%m%d_%H%M%S"`.dump.gz | |
S3LATEST=$S3PATH"latest".dump.gz | |
/usr/bin/aws s3 mb $S3PATH |
OlderNewer