Skip to content

Instantly share code, notes, and snippets.

echo 1,2,4,5,6,9 a,b,d,e,f,i | gawk '{
split($1, Number, ",");
split($2, Letter, ",");
fourIdx = -1;
nineIdx = -1;
for(x = 1; x <= length(Number); x++) {
if(Number[x] == 4) {
fourIdx = x;
}
if(Number[x] == 9) {
@songpp
songpp / commands.sh
Created July 30, 2016 08:29
git commands
git log --author="${user}" --pretty=tformat: --numstat | egrep '[^DAO]\.java' |gawk '{ add += $1 ; subs += $2 ; loc += $1 - $2 } END { printf "added lines: %s removed lines : %s total lines: %s\n",add,subs,loc }' -
@songpp
songpp / Sublime Text 3 Build 3103 License Key - CRACK
Created June 26, 2016 17:41
Sublime Text 3 Build 3103 License Key - CRACK
I use the first
—– BEGIN LICENSE —–
Michael Barnes
Single User License
EA7E-821385
8A353C41 872A0D5C DF9B2950 AFF6F667
C458EA6D 8EA3C286 98D1D650 131A97AB
AA919AEC EF20E143 B361B1E7 4C8B7F04
@songpp
songpp / introrx.md
Created June 26, 2016 17:40 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@songpp
songpp / The Technical Interview Cheat Sheet.md
Created June 26, 2016 17:34 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
@songpp
songpp / snippet.hs
Created December 4, 2015 06:26
state monad
listDirs :: FilePath -> IO [String]
listDirs = liftM (filter notDots) . getDirectoryContents
where notDots p = p /= "." && p /= ".."
countEntries :: FilePath -> WriterT [(FilePath, Int)] IO ()
countEntries path = do
contents <- liftIO . listDirs $ path
tell [(path, length contents)]
@songpp
songpp / jvm-parameters
Created July 7, 2015 09:04
print jvm default parameters
java -XX:+PrintFlagsFinal -version
#!/bin/bash
#
# git-svn-diff originally by (http://mojodna.net/2009/02/24/my-work-git-workflow.html)
# modified by mike@mikepearce.net
# modified by aconway@[redacted] - handle diffs that introduce new files
# modified by t.broyer@ltgt.net - fixes diffs that introduce new files
# modified by m@rkj.me - fix sed syntax issue in OS X
# modified by songpengpeng - fix sed newline issue in OS X
#
# Generate an SVN-compatible diff against the tip of the tracking branch
@songpp
songpp / hsdev_scan.sh
Created February 17, 2015 07:10
haskell hsdev utilities
#! /bin/bash
THIS_PROJECT=$(cd "$(dirname "$0")"; pwd);
THIS_PROJECT_DIR_NAME=$(basename "$THIS_PROJECT");
MY_SANDBOX=~/tools/dev-sandbox/;
set -x;
exec 3>&1
rescan() {
hsdev start --port 4567 --cache "$THIS_PROJECT/.hsdev" >&3;
@songpp
songpp / Params.hs
Last active August 29, 2015 14:06
a tiny, lovely generic (type indexed) parameter container
-- @Author: spp
-- @Date: 2014-09-26 17:16:53
-- @Last Modified by: spp
-- @Last Modified time: 2014-09-26 17:21:58
{-# LANGUAGE DataKinds, ScopedTypeVariables, DeriveDataTypeable, Rank2Types, ExistentialQuantification #-}
module Params(
Params,
Param,
mkParam,