Skip to content

Instantly share code, notes, and snippets.

View raypereda's full-sized avatar

Ray Pereda raypereda

  • Genesis Research Group
  • Long Beach, CA
View GitHub Profile
package main
import (
"net/http"
"fmt"
)
func main() {
http.Handle("/string", String("I'm a frayed knot."))
http.Handle("/struct", &Struct{"Hello", ":", "Gophers!"})
@raypereda
raypereda / gist:28540f3c9285046fb1d1
Created June 6, 2014 23:46
number of commits for each person in the last 48 hours
git shortlog -s -n --after "48 hours ago"

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@raypereda
raypereda / sum.rb
Created August 7, 2014 18:41
ruby sum columns of a text file (better than awk)
cat temp.txt | ruby -nae 'BEGIN { x = 0 }; puts "#{ x += $F[0].to_f }"'
@raypereda
raypereda / The Technical Interview Cheat Sheet.md
Created February 16, 2016 00:27 — forked from deepmehtait/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.
@raypereda
raypereda / Update remote repo
Last active May 12, 2018 06:06 — forked from mandiwise/Update remote repo
Transfer repo from Bitbucket to TFS
// Reference: http://www.blackdogfoundry.com/blog/moving-repository-from-bitbucket-to-github/
// See also: http://www.paulund.co.uk/change-url-of-git-repository
// These are steps for moving a git repo from Bitbucket to TFS
// 1. add your SSH keys to the TFS project (google for a guide)
// 2. follow the steps below
git clone git@bitbucket.org:<bitbucket_user>/<repo_name>.git
cd repo_name
git remote rename origin bitbucket
@raypereda
raypereda / physics1.py
Last active August 9, 2017 00:02
debugging physic number crunching
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Aug 8 12:33:35 2017
@author: paul
"""
from math import *
from pylab import plot,show,suptitle,xlabel,ylabel,scatter,grid,legend,title,figure,ylim,xlim,subplots
@raypereda
raypereda / dir-file-count.sh
Last active November 6, 2018 05:55
count the number of files in the directories 1 level below
find . -maxdepth 1 -exec echo {} \; -exec sh -c "find {} | wc -l " \;
tf history /collection:http://tfs.molina.mhc:8080/tfs/HSS/ $/HSS /recursive /v:D11/09/2017~D11/09/2018 /noprompt
Changeset User Date Comment
--------- ----------------- ----------
212041 Pawar, Ganeshrao 11/9/2018 CPL Vendor
212040 TFSSERVICE 11/9/2018 Updating file
212039 TFSSERVICE 11/9/2018 Updating file
212038 TFSSERVICE 11/9/2018 Updating file
212037 Kottam, Archana 11/9/2018 added checkpoint to avoid transaction log full error
@raypereda
raypereda / main.go
Created November 26, 2018 06:22 — forked from Hubro/main.go
Line counter written in Go
package main
import (
"bytes"
"fmt"
"io"
"os"
)