Skip to content

Instantly share code, notes, and snippets.

@PseudoSky
PseudoSky / .bash_profile
Last active December 12, 2017 04:19
dot files and environment (you should NEVER blindly use peoples dot files)
export PATH=/usr/local/lib:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin
. ~/dot/snowbash
. ~/dot/completions
genpath
export PATH="/usr/local/bin:$PATH";
export NODE_ENV="development"
export NVM_DIR="/usr/local/nvm"
@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;
@PseudoSky
PseudoSky / export-style.js
Last active October 9, 2018 21:50
Javascript function that will export all current css arrtibutes on a dom element
Element.prototype.es = (function () {
// Mapping between tag names and css default values lookup tables. This allows to exclude default values in the result.
var defaultStylesByTagName = {};
// Styles inherited from style sheets will not be rendered for elements with these tag names
var noStyleTags = {"BASE":true,"HEAD":true,"META":true,"NOFRAME":true,"NOSCRIPT":true,"PARAM":true,"SCRIPT":true,"STYLE":true,"TITLE":true};
// This list determines which css default values lookup tables are precomputed at load time
// Lookup tables for other tag names will be automatically built at runtime if needed
@PseudoSky
PseudoSky / elasticsearch-2.1.1-elog
Last active January 11, 2016 17:26
Heroic Error log for issue on mac.
Same results on elasticsearch versions
Version: 2.0.0, Build: de54438/2015-10-22T08:09:48Z, JVM: 1.8.0_45
Version: 2.1.1, Build: 40e2c53/2015-12-15T13:05:55Z, JVM: 1.8.0_45
Could it be JVM: 1.8.0_45?
[snow@snow elasticsearch-2.1.1]$ bin/elasticsearch
[2016-01-11 12:19:41,226][INFO ][node ] [Adri Nital] version[2.1.1], pid[88371], build[40e2c53/2015-12-15T13:05:55Z]
[2016-01-11 12:19:41,227][INFO ][node ] [Adri Nital] initializing ...
[2016-01-11 12:19:41,323][INFO ][plugins ] [Adri Nital] loaded [], sites []
[2016-01-11 12:19:41,344][INFO ][env ] [Adri Nital] using [1] data paths, mounts [[/ (/dev/disk1)]], net usable_space [79.6gb], net total_space [232.6gb], spins? [unknown], types [hfs]