Skip to content

Instantly share code, notes, and snippets.

View orderthruchaos's full-sized avatar

Brett DiFrischia orderthruchaos

View GitHub Profile
@orderthruchaos
orderthruchaos / IEx.exs
Last active November 28, 2019 12:44
A possible q/0 helper for Elixir.IEx.
if ! Enum.member?(:erlang.loaded, IEx.UserDrv.Config) do
defmodule IEx.UserDrv.Config do
import Process, only: [group_leader: 0]
@moduledoc """
Structure to hold :user_drv configuration information.
"""
defstruct node: Node.self, pid: nil, port: nil, leader: group_leader
@orderthruchaos
orderthruchaos / smile_amazon_com.user.js
Created April 7, 2015 15:03
Greasemonkey User Script: ensure that you are on smile.amazon.com.
// ==UserScript==
// @name smile_amazon_com
// @namespace http://orderthruchaos.bitbucket.org/
// @copyright 2015+, Brett DiFrischia
// @license
// @description Always remember to smile!
// @grant GM_log
// @require https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js
// @include http://www.amazon.com/*
// @include https://www.amazon.com/*
@orderthruchaos
orderthruchaos / install_phoenix.sh
Created February 22, 2016 21:15 — forked from ulve/install_phoenix.sh
Install Erlang/Elixir/Phoenix on a Raspberry Pi
#!/bin/bash
sudo apt-get update
sudo apt-get --assume-yes install wget
sudo apt-get --assume-yes install libssl-dev
sudo apt-get --assume-yes install ncurses-dev
sudo apt-get --assume-yes install m4
# erlang
wget http://erlang.org/download/otp_src_18.2.tar.gz
tar -xvzf otp_src_18.2.tar.gz
cd otp_src_18.2
defmodule GCM.PushCollector do
use GenStage
# Client
def push(pid, push_requests) do
GenServer.cast(pid, {:push, push_requests})
end
# Server
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,
@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. */

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 / pathogen_helptags_map.vim
Created January 27, 2012 15:42
Normal mode map for calling pathogen#helptags()
nnoremap <Leader>ph :call pathogen#helptags()<CR>
@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 / 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))