Skip to content

Instantly share code, notes, and snippets.

.m-2 { margin: -2em !important; }
.ml-2 { margin-left: -2em !important; }
.mr-2 { margin-right: -2em !important; }
.mt-2 { margin-top: -2em !important; }
.mb-2 { margin-bottom: -2em !important; }
@PseudoSky
PseudoSky / alias.sh
Last active August 19, 2016 18:09
OLD, look for .bash_profile
#!/bin/bash
md() {
mkdir -p "$*"
cd "$*"
}
alias gl="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %C(yellow):%an%Creset %Cgreen(%cr)%Creset' --abbrev-commit --date=relative";
alias gb='git branch'
alias simps='python -m SimpleHTTPServer'
alias kl='wget --limit-rate=200k --no-clobber --convert-links --random-wait -r -p -E -e robots=off -U mozilla'
alias flush_cache='dscacheutil -flushcache'
[
{
"args": null,
"command": "lower_case"
}
]
@PseudoSky
PseudoSky / lodash-mixins.js
Created May 21, 2016 18:18
My precious lodash secrets.
// ---------------------------------------------------------------------------//
// -------------------------------- Helpers --------------------------------- //
// ---------------------------------------------------------------------------//
function ignoreEqual(obj_v,src_v){
if(!obj_v || src_v == obj_v){
return null;
}
if(obj_v && src_v!= obj_v){
return obj_v;
from pandas import *
import numpy as np
from mrjob.job import MRJob
from mrjob.step import MRStep
from mrjob.protocol import JSONValueProtocol
def dist( p1, p2 ):
# Get the list of shared_items
if len(p1) == 0 or len(p2) == 0: return [-1,[]]
@PseudoSky
PseudoSky / skill_frequencies.py
Created April 26, 2016 21:46
Manipulating skill based user data with pandas
from pandas import *
import re,string
dat=read_json('./users.json')
# Words to take out (didn't seem useful / broke normal fmt)
stopwords=['\?','\(','\)','Framework','Foundation$','Foundation ','Architect$','Architect ','Developer$','Developer ','Development$','Development ']
# Make regex for finding all the stopwords, delimited by ors "|"
sp='|'.join(stopwords)
<!doctype html>
<html class="no-js" lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>BIRD'S EYE CARE</title>
<script src="https://d3js.org/d3.v3.min.js" charset="utf-8"></script>
<script src="
https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.10.0/lodash.js" charset="utf-8"></script>
#python common_friends.py friend.txt -q
from mrjob.job import MRJob
from mrjob.step import MRStep
from itertools import chain
class MAPR(MRJob):
def mapper(self, _, line):
p=line.split(" : ")
f=sorted(p[1].split())
for p2 in f: yield(sorted([p[0],p2]),f)
@PseudoSky
PseudoSky / freetype.rb
Created February 22, 2016 09:22
Untested Homebrew freetype Formula, URL & Version are at least correct.
class Freetype < Formula
desc "Software library to render fonts"
homepage "http://www.freetype.org"
url "https://sourceforge.net/projects/freetype/files/freetype2/2.4.10/freetype-2.4.10.tar.bz2"
mirror "https://sourceforge.net/projects/freetype/files/freetype2/2.4.10/freetype-2.4.10.tar.gz"
sha256 "0c8e242c33c45928de560d7d595db06feb41d1b22167e37260ceabe72f9e992f"
# Note: when bumping freetype's version, you must also bump revisions of formula with
# "full path" references to freetype in their pkgconfig.
# See https://github.com/Homebrew/homebrew/pull/44587
@PseudoSky
PseudoSky / plotter.pde
Created February 18, 2016 15:30
Nicer plotter for differential visualization
import processing.serial.*;
Serial myPort; // The serial port
int xPos = 1; // horizontal position of the graph
float inByte = 0;
float prev=0;
float prev2=0;
float norm=0;