Skip to content

Instantly share code, notes, and snippets.

View michaellopez's full-sized avatar

Michael Zetterberg fd. Lopez michaellopez

View GitHub Profile
@michaellopez
michaellopez / trello-activitiy
Created November 21, 2011 19:48
Trello activity userscript for FluidApp
// ==UserScript==
// @name Trello Activity
// @namespace http://fluidapp.com
// @description Displays a Growl notification for new activities every 5 seconds. Also updates the badge.
// @include *
// @author Michael Lopez (michael@weahead.se)
// ==/UserScript==
(function () {
if (window.fluid) {
@michaellopez
michaellopez / HOMEBREW_MAKE_JOBS=1 VERBOSE=1 brew install foo
Last active December 11, 2015 07:18
Subversion does not run after SQLite was converted to keg_only (10.6.8)
$ brew rm sqlite svn
Uninstalling /usr/local/Cellar/sqlite/3.7.15.1...
Uninstalling /usr/local/Cellar/subversion/1.7.8...
$ HOMEBREW_MAKE_JOBS=1 VERBOSE=1 brew install svn
==> Installing subversion dependency: sqlite
==> Downloading http://sqlite.org/sqlite-autoconf-3071501.tar.gz
Already downloaded: /Users/michael/Library/Caches/Homebrew/sqlite-3.7.15.1.tar.gz
/usr/bin/tar xf /Users/michael/Library/Caches/Homebrew/sqlite-3.7.15.1.tar.gz
==> ./configure --prefix=/usr/local/Cellar/sqlite/3.7.15.1 --disable-dependency-tracking --enable-dynamic-extensions
./configure --prefix=/usr/local/Cellar/sqlite/3.7.15.1 --disable-dependency-tracking --enable-dynamic-extensions
#!/bin/bash
#
# The reason of creating this script is that Endpoint Security VPN installs it's own application firewall kext cpfw.kext
# which prevents for example PPTP connections from this computer, which is not appropriate if you need subj connection just
# from time to time
# Usage: checkpoint.sh load|unload
# You will need sudo power, of course
#
if [ $1 == "unload" ]
@michaellopez
michaellopez / squashpr.sh
Last active December 14, 2015 09:18
Squash Github pull request to 1 commit
// Revised from http://blog.steveklabnik.com/posts/2012-11-08-how-to-squash-commits-in-a-github-pull-request
git fetch upstream
git checkout <branch name>
git rebase upstream/master -i
# choose squash for all of your commits, except the first one
# Edit the commit message to make sense, and describe all your changes
git push origin <branch name> -f
@michaellopez
michaellopez / unziptest.js
Created March 27, 2013 08:38
node-unzip event testcase
var unzip = require('unzip');
var path = 'output';
var file = 'file.zip';
var unzipStream = unzip.Extract({ path: path });
unzipStream.on('finish', function () { console.log('Zipstream Finish') });
unzipStream.on('data', function () { console.log('Zipstream Data') });
unzipStream.on('error', function () { console.log('Zipstream Error') });
unzipStream.on('close', function () { console.log('Zipstream Close') });
unzipStream.on('end', function () { console.log('Zipstream End') });
@michaellopez
michaellopez / trello-color-card-fluid.user.js
Last active December 25, 2015 05:29
Trello Color Card for Fluid
// ==UserScript==
// @name Trello Color Card
// @namespace http://weahead.se
// @author Michael Lopez <michael@weahead.se>
// @description Colors Trello cards depending on completed checklist items.
// @include https://trello.com/*
// ==/UserScript==
(function () {
if (window.fluid) {
@michaellopez
michaellopez / brew-update-fail-config
Created November 14, 2013 12:00
Output for brew issue 24290
$ brew --config
HOMEBREW_VERSION: 0.9.5
ORIGIN: https://github.com/mxcl/homebrew
HEAD: 36ba8e6805c9d5a00dc4c33d28b5c2728dc673db
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: quad-core 64-bit arrandale
OS X: 10.8.5-x86_64
CLT: 5.0.1.0.1.1377666378
GCC-4.2: build 5666
@michaellopez
michaellopez / Gruntfile.js
Last active January 2, 2016 23:08
Handle scientific e notation hash in Grunt
if (grunt.config.get('config.changeSet') === Infinity) {
grunt.log.writeln('ChangeSet was interpreted as Infinity. Trying to manually parse command line arguments.'.yellow);
grunt.log.writeln('A single "e" in the changeset is interpreted with scientific notation, sometimes causing "Infinity".'.yellow);
process.argv.forEach(function(val) {
if (val.indexOf('hgid') >= 0) {
var changeSet = val.split('=');
if (changeSet[1]) {
grunt.config.set('config.changeSet', changeSet[1]);
return false; // Break loop
@michaellopez
michaellopez / fluidapp-gmail.js
Last active August 29, 2015 13:58
Fluidapp Gmail badge + notifications
/**
* Description: Updates the badge to the unread count.
* Scrapes the inbox for new mail every 5 seconds and displays a notification for each new message.
* Does not support new messages in a conversation. I.e. 1 row in the inbox = 1 notification.
* Only tested on OS X Mountain Lion. This will break when Gmail changes their DOM!
*
* Patterns:
* *gmail.com*
* *mail.google.com*
* *google.com*mail*
@michaellopez
michaellopez / 1 — readme.md
Created May 2, 2014 09:29 — forked from jjb/1 — readme.md
Leave closed Trello
  1. go here and get your Developer Key (ignore that token) https://trello.com/1/appKey/
  2. visit this url, with your Developer Key inserted as shown https://trello.com/1/authorize?key=YOURDEVELOPERKEY&name=My+Application&expiration=1day&response_type=token&scope=read,write
  3. grant access, and then get the token that is produced on the next page
  • You'll need to add a file in the same directory called settings.py that contains strings for MY_KEY, MY_TOKEN, and USER_TOKEN (USER_TOKEN can be an empty string)
  • Run the script with the last line commented out to see what boards you're leaving. When you're ready to do it for real, uncomment the last line.