Skip to content

Instantly share code, notes, and snippets.

@buddy-sandidge
buddy-sandidge / hide-spam-potatoes.js
Created April 1, 2016 19:11
Hide raise your potatoes spam
// ==UserScript==
// @name Fuck Potatoes
// @namespace reddit/robin fuck potatoes
// @include https://www.reddit.com/robin/
// @version 1
// @grant none
// ==/UserScript==
function hideSpam() {
$('.robin-message--message').each(function () {
var spam = '🍠🍠🍠🍠🍠 ヽ༼ຈل͜ຈ༽ノ RAISE YOUR POTATOES ヽ༼ຈل͜ຈ༽ノ 🍠🍠🍠🍠🍠'
@buddy-sandidge
buddy-sandidge / README.md
Last active August 29, 2015 14:21
underscore vs lodash size

This is in responsie to the proposial to merge underscore and lodash. There is a question about the size of the two libraries with lodash having a lot of coments that get stripped out. To try to get a more apples to apples compairison, this is what I did.

  • Downloaded underscore 1.8.3 and lodash-compat 3.9.0, unminified development builds of both
  • Used the very simple jsmin to remove comments in both underscore and lodash
  • Use $ jscs --fix to create a consistant style in both

The results:

  • Underscore is 587 lines at about 32K
  • Lodash is 2702 lines at about 155K
@buddy-sandidge
buddy-sandidge / combinations-sum.py
Last active August 29, 2015 14:18
combinations sum problem
#!/usr/bin/env python
from __future__ import print_function
from itertools import combinations
import sys
def combinations_sum_range(lower, upper, numbers):
for size in range(len(numbers)):
for combo in set(combinations(numbers, size + 1)):
function extend(base, parent) {
for (var prop in parent) {
if (!base.hasOwnProperty(prop)) {
base[prop] = parent[prop];
}
}
}
function noop() {}
@buddy-sandidge
buddy-sandidge / all-services
Created September 4, 2012 17:51
All services needed to run the BM VM. Usage: ./all-services (start|stop|restart)
#!/usr/bin/env bash
cmd=$1
function do_cmd {
instance=$1
$cmd memcached config=$instance
}
do_cmd api_obj_cache
#!/usr/bin/env python
import datetime
import feedparser
import json
import os
from urlparse import urlparse
def readConfigFile():
"""Read the config file ~/.youtube-rss and return a dictionary"""
@buddy-sandidge
buddy-sandidge / experiment-html
Created May 10, 2012 17:50
make html5 boilerplate project
#!/usr/bin/env bash
experiment=$1
dir=~/experiments/$experiment
if [[ ! -d $dir ]]; then
mkdir $dir
git clone https://github.com/h5bp/html5-boilerplate.git $dir
cd $dir
rm -rf .git
@buddy-sandidge
buddy-sandidge / tmux.conf
Created April 30, 2012 17:13
tmux config
################################################################################
# Base configuration
################################################################################
# Use Ctrl-a as a prefix instead of Ctrl-b
set -g prefix C-a
unbind C-b
# More responsive with sending commands
set -sg escape-time 1
@buddy-sandidge
buddy-sandidge / index.html
Created February 11, 2012 01:12
CSS Snow
<!doctype html>
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="no-js ie7 oldie" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="no-js ie8 oldie" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title></title>
<meta name="description" content="">
@buddy-sandidge
buddy-sandidge / index.html
Created November 23, 2011 07:15
Canvas star thing
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Canvas Example</title>
<style>