Skip to content

Instantly share code, notes, and snippets.

View sillygwailo's full-sized avatar

Richard Eriksson sillygwailo

View GitHub Profile
@sillygwailo
sillygwailo / gist:4721047
Last active December 12, 2015 05:19
Yak Shaving to get Shareabouts working on dotCloud

Install dotCloud Python library

sudo easy_install pip && sudo pip install dotcloud

Create the API application

git clone https://github.com/openplans/shareabouts-api.git
cd shareabouts-api/
dotcloud create <api-name>

dotcloud push -A -b master --git

@sillygwailo
sillygwailo / gist:5265282
Created March 28, 2013 17:41
Yak shaving to get tmux installed on my Mac
$ sudo brew install tmux
[...]
configure: error: "libevent not found"
$ sudo brew install -v tmux
Error: You must `brew link libevent' before tmux can be installed
$ sudo brew link libevent
Linking /usr/local/Cellar/libevent/2.0.21... Warning: Could not link libevent. Unlinking...
Error: Could not symlink file: /usr/local/Cellar/libevent/2.0.21/include/event.h
Target /usr/local/include/event.h already exists. You may need to delete it.
@sillygwailo
sillygwailo / gist:5323122
Created April 5, 2013 22:17
Template tag for Atom feeds in Postach.io sites
<link rel="alternate" type="application/atom+xml" href="/feed" title="{{ site.name }}" />
@sillygwailo
sillygwailo / gist:5323270
Last active December 15, 2015 21:09
Yak Shaving to Install Tabula
$ git clone https://github.com/jazzido/tabula
[Worked.]
$ sudo brew install rbenv
[]
rbenv install 1.9.3-p392
rbenv: no such command `install'
$ rvm install 1.9.3-p392
[Worked?]
$ rvm install jruby-1.7.3
[...]
@sillygwailo
sillygwailo / bash.sh
Last active July 16, 2023 23:09
Beer in my terminal prompt on Fridays
# The following code goes in your ~/.profile
#
# This propmpt shows a beer when you launch a Terminal window on a Fridays.
# It checks every time you get a new prompt. A minute after 11:59M on a
# Thursday, if you press enter, it will add beer to the prompt. A minute
# after 11:59 PM on a Friday, no more beer.
#
# This is for terminals that use the Bash shell, which was the default for
# MacOS previous to Catalina.
@sillygwailo
sillygwailo / URLcruft.py
Last active December 17, 2015 23:09
Remove URLCruft using Pythonista on iOS
# Assumptions:
#
# - used with Pythonista on iOS
# - successful install of the Extraction module https://pypi.python.org/pypi/extraction
# through pipista and yak shaving with shellista
# Initially based on http://blog.ouseful.info/2010/10/26/more-python-floundering-stripping-google-analytics-tracking-codes-out-of-urls/
import cgi, urllib, urlparse, webbrowser, sys, console, clipboard, requests, extraction
@sillygwailo
sillygwailo / stellar-fluid-refresh.js
Last active December 19, 2015 02:09
Fluid UserScript to refresh Stellar.io when there's new items to read
setInterval(checkNewStellarRefresh, 5000);
function checkNewStellarRefresh() {
if(document.readyState != 'interactive') {
var notify_top = document.getElementsByClassName('notify-top');
var length = notify_top.length;
for (var i = 0; i < length; i++) {
if (notify_top[i].getElementsByTagName('a')[0].text == 'You have new items to read!') {
notify_top[i].getElementsByTagName('a')[0].click();
return;
@sillygwailo
sillygwailo / gist:6527986
Last active December 22, 2015 20:39
My Git workflow for Drupal.org issues

Git workflow for Drupal.org issues

Inspired by chx's workflow http://drupal4hu.com/node/374, this is the workflow I used when working on multiple issues at the same time to rename Views functions.

This workflow worked for me. YMMV.

Starting out:

  1. git clone --branch 8.x http://git.drupal.org/project/drupal.git 8 # checkout all of Drupal into a directory called 8
  2. Start working on an issue. Make commits on your work. Since you likely don't have commit access to the Drupal project, you won't break anything for anybody else.
@sillygwailo
sillygwailo / water.py
Created September 17, 2013 21:28
Line in /etc/crontab
# At the top of the hour, start a timer (sleep) every two hours
# between 8 AM and 6 PM. That timer lasts for a random duration of
# up to two hours. When that timer runs out, run a script that
# sends a notification to my iPhone or Android device to remind me
# to drink a glass of water. (And only on weekdays.)
0 8,10,12,14,16,18 * * 1,2,3,4,5 root sleep `/usr/bin/expr $RANDOM \% 7200`; python /full/path/here/water.py
@sillygwailo
sillygwailo / extract-ios-wallpaper.md
Last active October 19, 2024 17:11
Extract your iOS wallpaper if the image is not in your Camera Roll
  1. Backup your iOS device to your computer (not iCloud) through iTunes
  2. Download iPhone / iPod Touch Backup Extractor from http://supercrazyawesome.com/
  3. Run the app, and click "Read Backups"
  4. Find the backup you just made
  5. Make an empty directory
  6. Scroll all the way down and highlight "iOS Files"
  7. Extract the iOS files to the directory you made
  8. Visit https://www.dcode.fr/cpbitmap-format
  9. Click "Choose File"
  10. Inside the directory you created, find the iOS Files/Library/Springboard directory.