Skip to content

Instantly share code, notes, and snippets.

@cbadke
cbadke / gist:1955322
Created March 2, 2012 03:23
tmux config
bind | split-window -h
bind - split-window -v
# Set status bar
set -g status-bg black
set -g status-fg green
#set -g status-left '#[fg=green]#H'
set -g status-right-length 50
set -g status-left-length 50
set -g status-right '[#[fg=yellow]#(date +"%H:%M")#[fg=green]]'
@cbadke
cbadke / gist:3430364
Created August 22, 2012 22:51
c# git ignore
#ignore thumbnails created by windows
Thumbs.db
#ignore vim swap files
*.swp
#Ignore files build by Visual Studio
*.obj
*.exe
*.pdb
*.user
@cbadke
cbadke / PrimeFetcher.fs
Created November 23, 2012 00:35
Fetch Primes Attempt 1
module PrimeFetcherFSharp
let FetchPrimesUpTo (max : int) : int[] =
match max with
| x when x < 2 -> [||]
| x when x = 2 -> [|2|]
| x when x < 5 -> [|2; 3|]
| _ ->
let candidates = [|for x in 0 .. max -> if x < 2 then 0 else x|]
let RemoveMultiples (coll : int[]) (x : int) =
private static void descriptiveImp()
{
var weatherData = File.ReadAllLines(@"C:\weather.dat");
Func<string,DataPoint> ConvertLineToDataPoint = line => {
var currLine = line.Trim().Split(new[] { '\t' }, StringSplitOptions.RemoveEmptyEntries);
return new DataPoint
{
day = Int32.Parse(currLine[0]),
max = Int32.Parse(currLine[1]),
@cbadke
cbadke / gist:4990286
Last active December 13, 2015 23:18
Scan files for unique guids. Generate replacements. Replace each guid in all files, committing between each guid.
param (
[string] $path
)
$oldPath = $pwd
cd (Resolve-Path $path)
$files = grep -rIlE "[0-9a-fA-F]\{8\}-[0-9a-fA-F]\{4\}-[0-9a-fA-F]\{4\}-[0-9a-fA-F]\{4\}-[0-9a-fA-F]\{12\}" * |
? { !$_.Contains('.min.js') } |
@cbadke
cbadke / gist:5774213
Last active December 18, 2015 11:18
A friend asked for some reading to learn Java...

This probably isn't quite what you're looking for but...

First off I'm not a 'Java Programmer'. But that doesn't matter much. To get into a language, once you have exposure to languages in the 'family' it doesn't take long to gain the ability to bang away at the problem. You won't know the idioms of the language and you probably wont' know the best way to do certain things but you can find your way around.

Java is part of the C family of languages. C/C++/C#/Java and others all come from the same core and have diverged from each other over time.

For Java syntax people seem to like Java - The Good Parts or others. This StackOverflow question seems to have some appropriate discussion.

Beyond that the trick is to learn the underlying principles of programming. That is what will really get you going in the long run (although it takes longer in th

@cbadke
cbadke / keybase.md
Created September 18, 2014 18:02
keybase.md

Keybase proof

I hereby claim:

  • I am cbadke on github.
  • I am cbadke (https://keybase.io/cbadke) on keybase.
  • I have a public key whose fingerprint is C8D0 B5C7 5D9B B3EF 31F9 AC6C 0DDA DBAA 0E79 70EB

To claim this, I am signing this object:

____( \ .-' `-. / )____
(____ \_____ / (O O) \ _____/ ____)
(____ `-----( ) )-----' ____)
(____ _____________\ .____. /_____________ ____)
(______/ `-.____.-' \______)
@cbadke
cbadke / .vimrc
Last active April 24, 2017 16:08 — forked from napcs/.vimrc
Set up Vim on Mac, Linux, or Windows. For Mac and Linux: sh <(curl -s https://gist.githubusercontent.com/cbadke/fe5f5e16f0e0da2467d5/raw/vim.sh) For Windows: iex ((new-object net.webclient).DownloadString('https://gist.githubusercontent.com/cbadke/fe5f5e16f0e0da2467d5/raw/vim.ps1'))
" This is the main file that loads up the other configuration files.
if has('win32') || has ('win64')
let $VIMHOME = $HOME."/vimfiles"
else
let $VIMHOME = $HOME."/.vim"
endif
source $VIMHOME/vundle
source $VIMHOME/vimrc_main
@cbadke
cbadke / config-dev-machine.ps1
Last active March 10, 2017 16:49
Scripts to automatically configure a bare-bones Windows dev env. To use: iex ((new-object net.webclient).DownloadString('https://gist.githubusercontent.com/cbadke/85c983e2b99240ab0ef0/raw/config-dev-machine.ps1'))
#install Chocolatey
iex (new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1')
#install PsGet
iex (new-object Net.WebClient).DownloadString("http://psget.net/GetPsGet.ps1")
Install-Module PSReadLine
cinst githubforwindows -y
cinst gitextensions -y
cinst vim -y