Skip to content

Instantly share code, notes, and snippets.

@icecreammatt
icecreammatt / keybindings.json
Last active June 26, 2018 17:30
VSCode Bindings
// Place your key bindings in this file to overwrite the defaults
[
{
"key": "ctrl+h",
"command": "workbench.action.navigateLeft"
},
{
"key": "ctrl+l",
"command": "workbench.action.navigateRight"
},
@icecreammatt
icecreammatt / smoothing.ino
Created August 30, 2016 06:33
Analog Smoothing code
// https://github.com/mikewesthad/ExperimentalMedia/blob/master/people/mikewesthad/Week5/Arduino/AnalogReadWithSmoothing/AnalogReadWithSmoothing.ino
// https://github.com/bakercp/ExperimentalMedia2013/issues/43
const int potPin = A0;
const int BAUD_RATE = 9600;
// Array variables for tracking a window of potentiometer values
// We want to hold on to the last NUM_SAMPLES values and perform
// an average on them to arrive at a 'current' value - this
// is called a moving average: http://en.wikipedia.org/wiki/Moving_average

Keybase proof

I hereby claim:

  • I am icecreammatt on github.
  • I am mattcarrier (https://keybase.io/mattcarrier) on keybase.
  • I have a public key ASALuAchtA9o1n6qHwaEbxkYVOLo63mDqyz1JAm2saRYrwo

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am icecreammatt on github.
  • I am mattcarriermlb (https://keybase.io/mattcarriermlb) on keybase.
  • I have a public key ASCYbmyAjoV1sCVQCxZTA_MW7FxkgcD11iNdRTNdRcp2TAo

To claim this, I am signing this object:

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@icecreammatt
icecreammatt / cf-ddns.sh
Created November 11, 2015 17:50 — forked from larrybolt/cf-ddns.sh
Automatically update your CloudFlare DNS record to the IP, Dynamic DNS for Cloudflare
#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
# Automatically update your CloudFlare DNS record to the IP, Dynamic DNS
# Can retrieve cloudflare Domain id and list zone's, because, lazy
# Place at:
# /usr/local/bin/cf-ddns.sh
@icecreammatt
icecreammatt / gist:e9b9cf973a4a1212b8a7
Created September 11, 2015 06:17
Monitor log and call function when output matches pattern
#!/bin/sh
tail -fn0 /var/log/file.log | while read line ; do
echo "$line" | grep "pattern"
if [ $? = 0 ]
then
echo "Log: $line"
fi
done
@icecreammatt
icecreammatt / encfs-rsync.sh
Last active August 29, 2015 14:26 — forked from mschubert/encfs-rsync.sh
Script to (decrypt encfs and) selectively sync a remote sshfs directory
#!/bin/bash
# Script to (decrypt encfs and) selectively sync a remote sshfs directory
REMOTEDIR=server:/path/to/some/encfs
LOCALDIR=/path/to/local/directory
MOUNTFUNC=_ssh+encfs
# verbose
# set -vx
@icecreammatt
icecreammatt / convert-to-h264.sh
Created May 19, 2015 06:28
ffmpeg mpeg to h264 conversion
#!/bin/bash
# For each .mp4 file convert and rename to .mov
for x in *.mp4; do
ffmpeg -i $x -c:v libx264 -acodec aac -ab 192k -strict -2 -ac 2 -qp 0 ${x/.mp4/.mov};
done
from ftplib import FTP
# Server connection string
remoteUrl = 'ftp.debian.org'
ftp = FTP(remoteUrl)
# Login
ftp.login()
# Switch to folder