Skip to content

Instantly share code, notes, and snippets.

View ichpuchtli's full-sized avatar

Sam Macpherson ichpuchtli

View GitHub Profile
@jchandra74
jchandra74 / PowerShell Customization.md
Last active March 1, 2024 01:02
PowerShell, Cmder / ConEmu, Posh-Git, Oh-My-Posh, Powerline Customization

Pimping Up Your PowerShell & Cmder with Posh-Git, Oh-My-Posh, & Powerline Fonts

Backstory (TLDR)

I work as a full-stack developer at work. We are a Windows & Azure shop, so we are using Windows as our development platform, hence this customization.

For my console needs, I am using Cmder which is based on ConEmu with PowerShell as my shell of choice.

Yes, yes, I know nowadays you can use the Linux subsystem on Windows 10 which allow you to run Ubuntu on Windows. If you are looking for customization of the Ubuntu bash shell, check out this article by Scott Hanselman.

@rauchg
rauchg / README.md
Last active January 6, 2024 07:19
require-from-twitter
@remojansen
remojansen / class_decorator.ts
Last active September 14, 2023 14:54
TypeScript Decorators Examples
function logClass(target: any) {
// save a reference to the original constructor
var original = target;
// a utility function to generate instances of a class
function construct(constructor, args) {
var c : any = function () {
return constructor.apply(this, args);
}
@quimbs
quimbs / autocorrelation.js
Last active April 1, 2024 08:32
Sample implementation of Autocorrelation using Web Audio
var findFundamentalFreq = function(buffer, sampleRate) {
// We use Autocorrelation to find the fundamental frequency.
// In order to correlate the signal with itself (hence the name of the algorithm), we will check two points 'k' frames away.
// The autocorrelation index will be the average of these products. At the same time, we normalize the values.
// Source: http://www.phy.mty.edu/~suits/autocorrelation.html
// Assuming the sample rate is 48000Hz, a 'k' equal to 1000 would correspond to a 48Hz signal (48000/1000 = 48),
// while a 'k' equal to 8 would correspond to a 6000Hz one, which is enough to cover most (if not all)
// the notes we have in the notes.json file.
var n = 1024, bestR = 0, bestK = -1;
@staltz
staltz / introrx.md
Last active May 24, 2024 07:56
The introduction to Reactive Programming you've been missing
@trevordixon
trevordixon / parseCSV.js
Created May 25, 2014 03:07
Very Simple Javascript CSV Parser
function parseCSV(str) {
var arr = [];
var quote = false;
for (var row = col = c = 0; c < str.length; c++) {
var cc = str[c], nc = str[c+1];
arr[row] = arr[row] || [];
arr[row][col] = arr[row][col] || '';
if (cc == '"' && quote && nc == '"') { arr[row][col] += cc; ++c; continue; }
if (cc == '"') { quote = !quote; continue; }
@joegoggins
joegoggins / install and add gcc arm to PATH.sh
Last active December 12, 2022 06:59
How I installed GCC ARM on my Mac 10.9 Mac Book Pro
# Download the file manually from here https://launchpad.net/gcc-arm-embedded
# Note: `curl` command doesn't work
# I downloaded this one: "gcc-arm-none-eabi-4_7-2013q3-20130916-mac.tar.bz2"
# double click it to unzip it
# Make a place to install it to
mkdir /usr/local/gcc_arm
# Move the unzipped stuff there.
# this will install everything as root, so take that into account before you run it
# need cmake, python development headers, ZLib and OpenSSL
sudo apt-get install cmake python2.7-dev zlib1g-dev libssl-dev
mkdir libgit && cd libgit
git clone git://github.com/libgit2/libgit2.git
cd libgit2
@timothyandrew
timothyandrew / README.md
Last active December 16, 2023 17:05
Set up a seedbox (on DigitalOcean – Ubuntu) really quick

Introduction

  • This script lets you set up and use a temporary DigitalOcean droplet to download torrent files.
  • Once downloaded, they can be streamed down to your local machine.
  • This uses transmission-cli for the torrent client, and nginx to serve files.

Setup on Local Machine

  • This assumes that you have a DigitalOcean account and tugboat set up, as well as seedbox-setup.sh present in the current directory.
@matthiasg
matthiasg / docs style (bootstrap)
Created August 5, 2013 06:26
the callouts from the bootstrap documentation
/* Side notes for calling out things
-------------------------------------------------- */
/* Base styles (regardless of theme) */
.bs-callout {
margin: 20px 0;
padding: 15px 30px 15px 15px;
border-left: 5px solid #eee;