Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

#include <xc.inc>
#define STRIP_LENGTH 10
#define LED_STRIP PORTA, 0
GLOBAL _led_buffer
GLOBAL _populateLeds
PSECT ledcode,class=CODE,reloc=2
_populateLeds:
// ==UserScript==
// @name Hide Facebook Feed
// @namespace http://www.julianhartline.com
// @version 0.2
// @description enter something useful
// @match https://www.facebook.com/*
// @copyright 2013+, Julian
// @require http://code.jquery.com/jquery-latest.js
// ==/UserScript==
<?php header("Content-Type: text/plain"); ?>
<?php header("Content-Disposition: inline"); ?>
#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
#include <avr/power.h>
#endif
//IMPORTANT: Update the pin and length to match your LED strip!
#define PIN 5
#define LENGTH 150
@julianh2o
julianh2o / getSubredditSubscribers.js
Created March 23, 2016 04:43
A function for Google Sheets that automatically fetches the number of subscribers that a subreddit has. Simply pass in the name of the subreddit.
// Installation: On a Google Sheet, go to Tools > Script Editor and paste the code into the resulting editor.
// Save and return to your editor and use as follows:
// Usage: getSubredditSubscribers("funny")
// Supports subreddits in the following forms:
// programming
// http://www.reddit.com/r/electronics
//Refresh key can be used for force a refresh by including an arbitrary number
// ==UserScript==
// @name Reddit Robin Spam Filter
// @namespace http://julianhartline.com/
// @version 0.13
// @description Adds mute functionality and spam filter
// @author Julian Hartline (julianh2o)
// @match https://www.reddit.com/robin
// @grant none
// ==/UserScript==
@julianh2o
julianh2o / gitrecolordiffs.user.js
Created May 9, 2016 23:50
Changes the color of subtractions in Github diffs (Tampermonkey)
// ==UserScript==
// @name Github Recolor Diffs
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Red, Green? What's that
// @author You
// @match https://github.com/*
// @grant none
// ==/UserScript==
@julianh2o
julianh2o / refactor.sh
Last active September 15, 2016 01:18
Simple bash refactoring function (depends on SilverSearcher)
# Usage:
# First, search files recursively for text using ag (SilverSearcher). This could be refactored to use grep probably
# $ refactor gen 'function' > lines.txt
# Lines.txt will contain the file paths, line numbers, and line contents like so: (one entry per line)
# index.js:52: handler: function onNext() {
# Now, using your favorite editor, edit the lines.txt file with any changes you want to make to those lines (using something search replace, a text editor, or a bash script)
# Save the file and now run the script again to update all the files accordingly:
# refactor run lines.txt
# Note: You can also use `refactor dry lines.txt` to show the changes that will be made
@julianh2o
julianh2o / server.js
Created November 28, 2016 18:18
Voice-activated party mode with a NodeJS Server.
var request = require("request")
var express = require("express")
var app = express()
var LIFX_TOKEN='adbadbadbadbadbabdabdabdbad4adbadbadbadbadbabdbadbabdabdbadbabdb';
app.get("/", function (req, res) {
res.send("Hello World!")
})
@julianh2o
julianh2o / server.js
Created November 28, 2016 18:38
Voice-activated party mode with a NodeJS Server. (with Hue)
var request = require("request")
var express = require("express")
var app = express()
var LIFX_TOKEN='adbadbadbadbadbabdabdabdbad4adbadbadbadbadbabdbadbabdabdbadbabdb';
var HUE_TOKEN='adbadbadbadbadbabdabdab';
var HUE_IP="192.168.0.100";
app.get("/", function (req, res) {
res.send("Hello World!")
@julianh2o
julianh2o / partylights.js
Created November 28, 2016 18:48
Voice-activated party mode with a NodeJS Server, party mode picks random colors
var request = require("request")
var express = require('express');
var _ = require("underscore");
var app = express();
var exec = require('child_process').exec;
var lifx_token='asdasdasdasdasdasd''
var lifx_api='https://api.lifx.com/v1/lights'
var hue_token='asdasdasdasdasdasd'