Skip to content

Instantly share code, notes, and snippets.

View orderthruchaos's full-sized avatar

Brett DiFrischia orderthruchaos

View GitHub Profile
@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
@seangenabe
seangenabe / 118033.user.js
Created August 11, 2014 20:18
Ads Skipper (pulled from userscripts-mirror.org)
// ==UserScript==
// @name Ads Skipper
// @author .
// @namespace http://userscripts.org/scripts/show/118033
// @description No More waiting to skip their ads
// @updateURL http://userscripts.org/scripts/source/118033.meta.js
// @installURL http://userscripts.org/scripts/source/118033.user.js
// @version 3.2.6
// @grant unsafeWindow
#!/bin/sh
git filter-branch --env-filter '
OLD_EMAIL="[email protected]"
CORRECT_NAME="Your Correct Name"
CORRECT_EMAIL="[email protected]"
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
then
@deepakkumarnd
deepakkumarnd / server_setup.sh
Last active October 8, 2024 00:49
Server setup script
# This script has to be run as a root user
echo "* Updating system"
apt-get update
apt-get -y upgrade
echo "* Installing packages"
apt-get -y install build-essential libmagickcore-dev imagemagick libmagickwand-dev libxml2-dev libxslt1-dev git-core nginx redis-server curl nodejs htop
id -u deploy &> /dev/null
if [ $? -ne 0 ]
@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>
@mwhite
mwhite / git-aliases.md
Last active March 23, 2025 00:40
The Ultimate Git Alias Setup

The Ultimate Git Alias Setup

If you use git on the command-line, you'll eventually find yourself wanting aliases for your most commonly-used commands. It's incredibly useful to be able to explore your repos with only a few keystrokes that eventually get hardcoded into muscle memory.

Some people don't add aliases because they don't want to have to adjust to not having them on a remote server. Personally, I find that having aliases doesn't mean I that forget the underlying commands, and aliases provide such a massive improvement to my workflow that it would be crazy not to have them.

The simplest way to add an alias for a specific git command is to use a standard bash alias.

# .bashrc
@sasa1977
sasa1977 / xmerl_demo.ex
Last active July 26, 2023 10:07
Simple xmerl usage demo in Elixir
defmodule XmlNode do
require Record
Record.defrecord :xmlAttribute, Record.extract(:xmlAttribute, from_lib: "xmerl/include/xmerl.hrl")
Record.defrecord :xmlText, Record.extract(:xmlText, from_lib: "xmerl/include/xmerl.hrl")
def from_string(xml_string, options \\ [quiet: true]) do
{doc, []} =
xml_string
|> :binary.bin_to_list
|> :xmerl_scan.string(options)
--- 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)
@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
@paulcc
paulcc / gist:3799331
Created September 28, 2012 11:43
list of four-letter words to go with https://gist.github.com/3733182
aahs
abbe
abbr
abed
abet
able
ably
abut
acct
aced