Skip to content

Instantly share code, notes, and snippets.

View sillygwailo's full-sized avatar

Richard Eriksson sillygwailo

View GitHub Profile
@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 / 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 / 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 / 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 / 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 / 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: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: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:3837156
Created October 4, 2012 23:40
Yak Shaving to Install Change By Us on a Mac (Mountain Lion)
https://github.com/localprojects/Change-By-Us
https://github.com/localprojects/Change-By-Us/wiki/Installation-Instructions-%28Mac%29
When installing lighthttpd through Homebrew, got this message:
* undefined method `xcrun'
Search for that led to https://github.com/mxcl/homebrew/issues/10327 Upgrade Homebrew
Tried sudo brew upgrade, attempted to upgrade 8 packages.
@sillygwailo
sillygwailo / gist:3814331
Created October 1, 2012 20:52
Yak Shaving to re-install Flash for Safari on Mountain Lion
I'm tired of not having Adobe Flash on Safari, and no, I don't want to switch full-time to Chrome. Here's what I've tried to get Flash installed again, to no avail.
1. the "uninstall then install" trick using the software downloads
2. removing references to /Library/Internet Plug-Ins/Flash Player and anything like it
Haven't tried:
* completely resetting Safari (but if Flash in Firefox doesn't work, why would it work in Safari?)
* completely re-installing my OS (so need to do it, but so very time consuming to get back to a working state)