Skip to content

Instantly share code, notes, and snippets.

View 8bitDesigner's full-sized avatar

Paul Sweeney 8bitDesigner

  • Cisco Meraki
  • Los Angeles
View GitHub Profile
@8bitDesigner
8bitDesigner / playlister.js
Created April 18, 2013 18:30
Export your Turntable.fm playlist as JSON, via very hacky script.
var playlist = $('.songs .song').toArray().map(function(song) {
var song = $(song)
, deets = song.find('.details').text().split(' • ')
, image = $(song).find('.thumb').attr('style')
return {
title: song.find('.title').text(),
artist: deets.shift(),
length: deets.shift(),
cover: image ? /\((.*)\)/.exec(image).pop() : null
@8bitDesigner
8bitDesigner / 1.md
Last active December 16, 2015 12:49

Tiny chat app powered by CouchDB

This was cloned off of some work by the fantastic Max Odgen, and does a great job of showing what CouchDB can do.

Messages in the by_time view:

Client side display

@8bitDesigner
8bitDesigner / remove.sh
Created May 13, 2013 19:54
MacPorts: Recursively remove remnant ports
while [[ -n $(port list leaves 2> /dev/null) ]]; do
sudo port uninstall leaves
done
@8bitDesigner
8bitDesigner / uneff.sh
Created May 23, 2013 00:17
When your homebrew certfiles get all effed
cert_file="$( openssl version -d | awk -F'"' '{print $2}' )/cert.pem"
mkdir -p "${cert_file%/*}"
security find-certificate -a -p /Library/Keychains/System.keychain > "$cert_file"
security find-certificate -a -p /System/Library/Keychains/SystemRootCertificates.keychain >> "$cert_file"
@8bitDesigner
8bitDesigner / 1.md
Last active February 1, 2024 06:42
Git post-merge hook which, when you run `git merge` or `git pull` will then `bundle` if the project's Gemfile changed, or `npm install` if the project's package.json changed.Inspired and based off of https://gist.github.com/bumi/5706550

Make bundleing and npm installing easy

This repo has some handy handy hooks to run bundle or npm install whenever you:

  • git checkout a new branch with a different Gemfile or package.json
  • git pull a change to Gemfile or package.json

How can I has this!!?

  1. git clone https://gist.github.com/5869846.git hooks && cd hooks && chmod +x install
@8bitDesigner
8bitDesigner / burnThem.js
Last active December 19, 2015 05:19
Find and log every DOMNode on the page which isn't using Proxima Nova as its font-family
// Find and log every DOMNode on the page which isn't using Proxima Nova
// as its font-family
function isHeretic(node) { return (window.getComputedStyle(node).fontFamily.indexOf('proxima-nova') < 0) }
function isVisible(node) { return (window.getComputedStyle(node).display !== 'none') }
function log(node) { console.log(node, window.getComputedStyle(node).fontFamily) }
function toArray(domlist) { return Array.prototype.slice.call(domlist) }
toArray(document.querySelectorAll('#fs-main-content *')).filter(isHeretic).filter(isVisible).forEach(log)
@8bitDesigner
8bitDesigner / 1_loader.md
Last active December 19, 2015 07:49
Simple evented ready state delegator, for cases where you don't have access to anything better.

Set up

<!-- Add this to your Rails app's body tag -->
<body data-controller="<%= request[:controller] %>" data-action="<%= request[:action] %>">

Usage

@8bitDesigner
8bitDesigner / README.md
Last active December 20, 2015 19:59
6-Line Static file server

Simple Static file server

Handy for when working on single-page apps

Usage

  1. npm install -g server-here
  2. here (if you're in a folder with files you want to serve)

Options

here --dir [directory to load files from] --port [port to use]

@8bitDesigner
8bitDesigner / cookie.coffee
Created August 13, 2013 21:17
Cookie accessor
@8bitDesigner
8bitDesigner / _usage.js
Last active December 21, 2015 05:08
Properly inheriting objects in Javasacript
function Child() {
Parent.call(this);
}
extends(Child, Parent);