Skip to content

Instantly share code, notes, and snippets.

View orderthruchaos's full-sized avatar

Brett DiFrischia orderthruchaos

View GitHub Profile
@jfreeze
jfreeze / gist:9423233
Created March 8, 2014 00:34
Installing Elixir on Raspberry Pi
My quick notes on what I did to install Elixir on the Raspberry Pi.
All the info is here, but it's a self guided tour.
# Get Raspbian
http://www.raspberrypi.org/downloads
http://downloads.raspberrypi.org/raspbian_latest
# Copy raspbian.img file to th SD Card
diskutils unmountDisk /dev/disk<numberhere>
require('Task/Joose/NodeJS')
use('KiokuJS.Backend.CouchDB', function () {
// class declaration
Class('Person', {
has : {
self : null,
@beastaugh
beastaugh / installing-ghc7.2-osx10.7.md
Created August 24, 2011 21:41
Installing GHC 7.2 on Mac OS X 10.7 Lion

Installing GHC 7.2 on Mac OS X

This is a brief and bare-bones guide to getting GHC 7.2 and the cabal-install tool (the two basic things you'll need to do Haskell development) up and running on a new Mac OS X 10.7 install.

The instructions given here worked for me, but YMMV.

@tech2077
tech2077 / pylcd.py
Last active October 6, 2015 08:07
PCA8574 Controlled HD44780 LCD library
'''
Copyright (C) 2012 Matthew Skolaut
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
associated documentation files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, distribute,
sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial
@snoyberg
snoyberg / Jqplot.hs
Created October 3, 2012 22:02
Create a reusable widget for jqplot
{-# LANGUAGE OverloadedStrings, TemplateHaskell, RecordWildCards #-}
-- | We're going to provide a module that provides a pure-Haskell interface to
-- the jqplot library. To use it, you don't need to write any HTML, CSS, or
-- Javascript in your code, as we'll see in our example app.
--
-- The idea is that all of the low-level Javascript code goes in this module,
-- and apps just deal with the widget.
--
-- Note that, for simplicity, we're only implementing a tiny subset of jqPlot's
--- client.c.orig 2013-06-02 15:29:03.175177500 -0500
+++ client.c 2013-06-02 15:32:59.124455900 -0500
@@ -328,8 +328,12 @@
strlcpy(data.term, term, sizeof data.term) >= sizeof data.term)
*data.term = '\0';
+#ifdef __CYGWIN__
+ snprintf(&data.ttyname, sizeof(data.ttyname), "%s", ttyname(STDIN_FILENO));
+#else
if ((fd = dup(STDIN_FILENO)) == -1)
@bvandgrift
bvandgrift / let-placement.clj
Created January 7, 2016 18:24
placing your peek inside of a dosync avoids potential thread conflict (from Clojure Applied forum)
;; response to: https://forums.pragprog.com/forums/352/topics/13835
;; this is a quick demonstration of the pitfalls in querying for a ref
;; outside of the accompanying transaction in which you plan on changing it.
(import '(java.util.concurrent Executors))
;; start list
(def slist (ref #{}))
@ladyada
ladyada / pitftupdater.sh
Last active December 6, 2016 03:25
PiTFT updater scripty
#!/bin/bash
# PiTFT Resistive 2.8" (PID 1601) or Capacitive 2.8" (PID 1983) setup script or Resistive 3.5" (PID 2097) or 2.2" No-Touchscreen setup script!
set -e
function cleanup() {
if [ "${mountpoint}" != "/" ]
then
sudo -n umount "${mountpoint}/boot" 2> /dev/null
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,
@tmelz
tmelz / center.vim
Created January 2, 2012 22:10
Vim: center current window in screen
let g:centerinscreen_active = 0
function! ToggleCenterInScreen(desired_width)
if g:centerinscreen_active == 0
let l:window_width = winwidth(winnr())
let l:sidepanel_width = (l:window_width - a:desired_width) / 2
exec("silent leftabove " . l:sidepanel_width . "vsplit new")
wincmd l
exec("silent rightbelow " . l:sidepanel_width . "vsplit new")