Skip to content

Instantly share code, notes, and snippets.

View ruliana's full-sized avatar

Ronie Uliana ruliana

View GitHub Profile
@ruliana
ruliana / Guardfile
Last active June 13, 2018 02:08
Guardfile to run rubocop after tests pass
# Run rubocop after all tests pass
group :tdd, halt_on_fail: true do
guard :rspec,
cmd: 'bundle exec rspec -f documentation --color',
run_all: {cmd: 'bundle exec rspec -f documentation --color'},
keep: true,
all_on_start: true,
all_after_pass: true do
@ruliana
ruliana / nativobrasileiro.keylaout
Last active September 25, 2018 13:06
Teclado Nativo Brasileiro para MacBook
<?xml version="1.1" encoding="UTF-8"?>
<!DOCTYPE keyboard SYSTEM "file://localhost/System/Library/DTDs/KeyboardLayout.dtd">
<!--Last edited by Ukelele version 3.2.2.166 on 2017-03-06 at 13:11 (BRT)-->
<keyboard group="126" id="-29669" name="Brasileiro Nativo" maxout="1">
<layouts>
<layout first="0" last="17" mapSet="16c" modifiers="f4"/>
<layout first="18" last="18" mapSet="a88" modifiers="f4"/>
<layout first="21" last="23" mapSet="a88" modifiers="f4"/>
<layout first="30" last="30" mapSet="a88" modifiers="f4"/>
<layout first="194" last="194" mapSet="a88" modifiers="f4"/>
@shaypal5
shaypal5 / confusion_matrix_pretty_print.py
Last active April 25, 2024 07:37
Pretty print a confusion matrix with seaborn
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
def print_confusion_matrix(confusion_matrix, class_names, figsize = (10,7), fontsize=14):
"""Prints a confusion matrix, as returned by sklearn.metrics.confusion_matrix, as a heatmap.
Note that due to returning the created figure object, when this funciton is called in a
notebook the figure willl be printed twice. To prevent this, either append ; to your
function call, or modify the function by commenting out the return expression.
@ruliana
ruliana / create_samples.sh
Last active November 17, 2016 12:00
Create 9 samples of data from a big CSV
seq 1 9 | xargs -I{} sh -c 'shuf everything.csv -n 999 > sample_{}.csv'
@ruliana
ruliana / time_lapse.sh
Created November 20, 2014 14:49
Photos => Time Lapse Video (GoPro with Linux and zsh)
# ZSH only
print -rl **/*(.Om) > frames.txt
mencoder -nosound -ovc lavc -lavcopts vcodec=mpeg4:mbd=2:trell:autoaspect:vqscale=3 -vf scale=1920:1080 -mf type=jpeg:fps=24 mf://@frames.txt -o time-lapse.avi
@willurd
willurd / web-servers.md
Last active April 28, 2024 21:38
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
#!/usr/bin/env ruby
#------------------------------------------------------------------------------
# Aggregate Print useful information from /proc/[pid]/smaps
#
# pss - Roughly the amount of memory that is "really" being used by the pid
# swap - Amount of swap this process is currently using
#
# Reference:
# http://www.mjmwired.net/kernel/Documentation/filesystems/proc.txt#361
@wildlyinaccurate
wildlyinaccurate / watch.sh
Last active December 14, 2015 11:58
Simple script to run the CoffeeScript and Sass "watch" commands
#!/bin/bash
PIDFILE=".watch.pid"
touch $PIDFILE || (echo "Unable to write to .watch.pid" && exit 1)
# Kill off old processes
while read pid; do
kill $pid
done < $PIDFILE
@krzysztofjablonski
krzysztofjablonski / gist:3904887
Created October 17, 2012 10:36
country2language
{
"AD" => ["Catalan"],
"AE" => ["Arabic"],
"AF" => ["Dari", "Pashto"],
"AG" => ["English"],
"AI" => ["English"],
"AL" => ["Albaniana"],
"AM" => ["Armenian"],
"AN" => ["Dutch", "Papiamento"],
"AR" => ["Spanish"],
@danking
danking / gist:1068185
Created July 6, 2011 19:55
A very simple example showing how to use Racket's lexing and parsing utilities
#lang racket
(require parser-tools/lex
(prefix-in re- parser-tools/lex-sre)
parser-tools/yacc)
(provide (all-defined-out))
(define-tokens a (NUM VAR))
(define-empty-tokens b (+ - EOF LET IN))
(define-lex-trans number
(syntax-rules ()