Skip to content

Instantly share code, notes, and snippets.

View orderthruchaos's full-sized avatar

Brett DiFrischia orderthruchaos

View GitHub Profile
@orderthruchaos
orderthruchaos / hex_pm_pages.user.js
Last active August 29, 2015 14:17
Greasemonkey User Script: add "first page" and "last page" links to hex.pm package listing.
// ==UserScript==
// @name hex_pm_pages
// @namespace http://orderthruchaos.bitbucket.org/
// @copyright 2015+, Brett DiFrischia
// @license
// @description
// @grant GM_log
// @require https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js
// @include https://hex.pm/packages
// @include https://hex.pm/packages?*
@orderthruchaos
orderthruchaos / rand_sig.m
Created March 31, 2015 15:53
MATLAB function to create randomized list of 2 values.
function [ sigmas ] = rand_sig( s1, s2, p, n )
% RAND_SIG Generate random list of sigmas
% sigs = rand_sig(0.5, 0.45, 0.65, 100000);
%
% Arguments:
% s1 = first standard deviation
% s2 = second standard deviation
% p = probability (decimal) of s1 occurring
% n = number of items to generate
@orderthruchaos
orderthruchaos / hex_pm_hexdocs_link.user.js
Created April 7, 2015 15:01
Greasemonkey User Script: add hexdoc.pm link to hex.pm package information page.
@orderthruchaos
orderthruchaos / bnd_utils.clj
Created September 10, 2015 23:37
Implementation of `def-` for Clojure
(ns bnd-utils)
; Based on the definition of defn-
(defmacro def-
"same as def, yielding non-public def"
[name & decls]
(let [m (assoc (meta name) :private true)]
`(do
(def ~name ~@decls)
(alter-meta! (var ~name) assoc :private true))
@orderthruchaos
orderthruchaos / arduino_indent.vim
Created May 12, 2011 16:19
Arduino indent file...
" Vim syntax file
" Language: Arduino
" Maintainer: Brett DiFrischia <orderthruchaos _at_ gmail _dot_ com>
" Last Change: 2011-05-12
" License: VIM license (:help license, replace vim by arduino.vim)
" Based on syntax/arduino.vim (by Johannes Hoff) initial setup.
" Read the C++ indent script to start with
if version < 600
@orderthruchaos
orderthruchaos / pathogen_helptags_map.vim
Created January 27, 2012 15:42
Normal mode map for calling pathogen#helptags()
nnoremap <Leader>ph :call pathogen#helptags()<CR>

City Construction Site

Get it? Site? oh man.

Demos for GreenSock's latest 18.0 release, with stagger cycle and hsl tweens, as well as jQuery3.0 with class operations on SVG. So many goodies. SVG.

A Pen by Sarah Drasner on CodePen.

License.

@orderthruchaos
orderthruchaos / grove_led_bar_with_rotary_controller.ino
Created October 5, 2016 20:56
Concatenation of files for the Grove LED bar controller with the Bean+ project.
/* This is a concatenation of the following files from
https://github.com/Seeed-Studio/Grove_LED_Bar (LGPL):
- Grove_LED_Bar.h
- Grove_LED_Bar.cpp (less the #include for the above header)
and the code from
https://www.hackster.io/karel/grove-led-bar-controller-with-the-bean-c3b81e
(less the #include for the above header) with corrections from the
comments. */
defmodule GCM.Pusher do
use GenStage
# The maximum number of requests Firebase allows at once per XMPP connection
@max_demand 100
defstruct [
:producer,
:producer_from,
:fcm_conn_pid,
:pending_requests,
defmodule GCM.PushCollector do
use GenStage
# Client
def push(pid, push_requests) do
GenServer.cast(pid, {:push, push_requests})
end
# Server