Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
mkdir tmp.$$
for i in {0..9999}; do
echo ".x$i{color:green;}"
done > tmp.$$/main.scss
rm -rf .sass-cache
echo Sass:
@hlung
hlung / How to connect PS3 controller to a Mac or PC.md
Last active May 13, 2024 03:39
How to connect PS3 controller to a Mac or PC

How to connect PS3 controller to a Mac or PC

This is how you connect PS3 controller to Mac OSX, PC, etc. when previously connected to a PS3. You will need a Mini USB cable. Overcome your laziness, get up of your chair, and go get one!

A big misconception is that keep holding PS button will reset the controller's pairing. It DOES NOT! From my testings, the controller keeps paring with the last machine it was CONNECTED VIA A USB CABLE.

Here are the steps:

@gillibrand
gillibrand / totalhours.py
Last active January 2, 2016 01:59
A custom preprocessor for Marked.app that makes it into a super simple time tracker. Finds all the hours in a document (e.g., +1h, +2h, +3h, etc.) and shows the total in a floating badge. Only looks for whole number hours (no minutes or fractions). See a screenshot at http://cl.ly/TB7D
#!/usr/bin/env python
import sys, re
hours_re = re.compile(r'([-+] \d+)h \b', re.X)
total = 0
for line in sys.stdin:
total += sum(int(hour) for hour in hours_re.findall(line))
print line.strip()
@bdone
bdone / brewstack install
Last active December 18, 2015 19:48 — forked from shrop/brewStack.md
# brewstack install
### Install steps:
* Install Homebrew
$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
$ brew install git
$ brew install homebrew/php/php56
$ brew install mariadb
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active May 7, 2024 01:27
A badass list of frontend development resources I collected over time.
@carwin
carwin / private.xml
Last active July 27, 2017 15:06
Programmer's Shift Keys: Remapping parens, brackets and braces for to because nerd.
<?xml version="1.0"?>
<root>
<item>
<name>Programmer's Shift Keys</name>
<!--
Author: Carwin Young (@carwin)
Last Updated: 2014.07.18
v.1.1
Programmer's Shift Keys
@shrop
shrop / brewStack.md
Last active October 11, 2023 20:18
brewStack Docs
@kconragan
kconragan / keyrepeat.shell
Last active December 4, 2023 03:40
Enable key repeat in Apple Lion for Sublime Text in Vim mode
# Mac OS X Lion introduced a new, iOS-like context menu when you press and hold a key
# that enables you to choose a character from a menu of options. If you are on Lion
# try it by pressing and holding down 'e' in any app that uses the default NSTextField
# for input.
#
# It's a nice feature and continues the blending of Mac OS X and iOS features. However,
# it's a nightmare to deal with in Sublime Text if you're running Vintage (Vim) mode,
# as it means you cannot press and hold h/j/k/l to move through your file. You have
# to repeatedly press the keys to navigate.
@mailtruck
mailtruck / colormeter.js
Created April 18, 2012 07:09 — forked from krypton/colormeter.js
Calculate difference in percentage between 2 hex colors
function color_meter(cwith, ccolor) {
if (!cwith && !ccolor) return;
var _cwith = (cwith.charAt(0)=="#") ? cwith.substring(1,7) : cwith;
var _ccolor = (ccolor.charAt(0)=="#") ? ccolor.substring(1,7) : ccolor;
var _r = parseInt(_cwith.substring(0,2), 16);
var _g = parseInt(_cwith.substring(2,4), 16);
var _b = parseInt(_cwith.substring(4,6), 16);
@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#