Skip to content

Instantly share code, notes, and snippets.

View cpoliver's full-sized avatar

Charles P Oliver cpoliver

View GitHub Profile
@banksean
banksean / mersenne-twister.js
Created February 10, 2010 16:24
a Mersenne Twister implementation in javascript. Makes up for Math.random() not letting you specify a seed value.
/*
I've wrapped Makoto Matsumoto and Takuji Nishimura's code in a namespace
so it's better encapsulated. Now you can have multiple random number generators
and they won't stomp all over eachother's state.
If you want to use this as a substitute for Math.random(), use the random()
method like so:
var m = new MersenneTwister();
@benatkin
benatkin / Global.sublime-settings
Created July 20, 2011 04:26
excluding node_modules from Sublime Text 2
// Place user-specific overrides in this file, to ensure they're preserved
// when upgrading
{
"folder_exclude_patterns": [".svn", ".git", ".hg", "CVS", "node_modules"]
}
#!/usr/bin/env ruby
#
# git fuzzy-checkout
# Same as `git checkout branch`, but with fuzzy matching if checkout fails.
# Turns `git checkout barnch` into `git checkout branch`,
# assuming `branch` is a branch.
# to use, you can alias:
# alias co="git fuzzy-checkout"
# co msater
@mwhite
mwhite / git-aliases.md
Last active April 30, 2024 11:32
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
@fd0
fd0 / gist:6951577
Created October 12, 2013 15:54
i3 multi monitor config snippet
# assign workspaces to screens
workspace 1 output DVI-I-1
workspace 2 output DVI-I-1
workspace 3 output DVI-I-1
workspace 4 output DVI-I-1
workspace 5 output DVI-I-1
workspace 6 output HDMI-0
workspace 7 output HDMI-0
workspace 8 output HDMI-0
workspace 9 output HDMI-0
@brc
brc / vmware-tools.md
Last active May 18, 2018 11:35
Installing VMWare tools in Arch Linux

Install OEM VMwareTools

git clone https://github.com/rasa/vmware-tools-patches.git
cd vmware-tools-patches
curl -O https://softwareupdate.vmware.com/cds/vmw-desktop/fusion/6.0.5/2209127/packages/com.vmware.fusion.tools.linux.zip.tar
for i in {0..6}; do sudo mkdir -pv /etc/init.d/rc${i}.d; done
sudo pacman -S net-utils
./untar-and-patch-and-compile.sh
@stephenway
stephenway / README.md
Last active April 13, 2024 21:45
BEMIT Cheatsheet
@romuloctba
romuloctba / readme.md
Last active August 1, 2023 12:03
Install Adobe Photoshop CS6 on Wine (Ubuntu, Elementary OS, Linux Mint)

Step 1. Install the Wine Team Ubuntu PPA

First start by installing Wine btw it's a utility to install windows apps in linux :

open the Terminal and :

   sudo add-apt-repository ppa:ubuntu-wine/ppa     
   sudo apt-get update && sudo apt-get upgrade
   sudo apt-get install wine1.7 winetricks
autoload -U add-zsh-hook
load-nvmrc() {
if [[ -f .nvmrc && -r .nvmrc ]]; then
nvm use
fi
}
add-zsh-hook chpwd load-nvmrc
@mkoura
mkoura / vpn-toggle
Last active February 8, 2018 08:21
script for starting/stopping vpn using Network Manager on Linux - can be used via keyboard shortcut
#!/bin/sh
# list of configured VPNs:
# nmcli con show |grep vpn
# PIA London PPTP
uuid="07067b81-d1d8-46cb-8b92-59341c69fe73"
# PIA NL PPTP
#uuid="f8ac9237-4865-4757-a78d-8d525dc846e5"