Skip to content

Instantly share code, notes, and snippets.

@cshireman
cshireman / fix-certbot.sh
Created Jul 8, 2020
Repair a certbot installation when python errors happen.
View fix-certbot.sh
#!/bin/bash
sudo /opt/eff.org/certbot/venv/local/bin/pip install cryptography interface zope
View Titanium: Color Animation
function parseColor(color) {
// from http://www.bitstorm.org/jquery/color-animation/jquery.animate-colors.js
var match, triplet;
// Match #aabbcc
if (match = /#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})/.exec(color)) {
triplet = [parseInt(match[1], 16), parseInt(match[2], 16), parseInt(match[3], 16), 1];
// Match #abc
} else if (match = /#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])/.exec(color)) {
@cshireman
cshireman / phabricator_workflow.sh
Created Aug 15, 2014
BASH: Phabricator workflow bash functions
View phabricator_workflow.sh
RELEASE_BRANCH=release/v2.0.0
# Shortcut replacement for fetching and rebasing into your current branch. This can be used either as a substitute for git pull, or a way to rebase changes from the primary branch into your local feature/bug branch.
# $1 = either 'dev' or 'rel' depending on which branch you want to rebase into your branch. If it is neither 'dev' or 'rel' then it should be a remote branch you want to rebase into your branch (e.g. origin/branch_name)
#
# Example usage: gitup dev
# Example usage: gitup rel
# Example usage: gitup origin/branch_name
gitup()
{
@cshireman
cshireman / gist:288426a6f8a09cbaa243
Created Aug 14, 2014
Titanium: Alloy viewDidAppear
View gist:288426a6f8a09cbaa243
//Equivalent to viewDidAppear. Have to use a state variable to make sure this is only called once.
$.hasAppeared = false;
$.getView().addEventListener("postlayout",function(){
if(!$.hasAppeared)
{
$.hasAppeared = true;
}
});
View gist:e5ad09eedd605957e064
/**
* filename.js
* Description: File description goes here
* Author: Christopher Shireman
* Create Date: Today's Date
*/