Skip to content

Instantly share code, notes, and snippets.

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
void print_usage(){
printf("usage: \n");
printf(" -b host path\n");
printf(" -e id\n");
}
@karadza3a
karadza3a / Objective-c auto formatting git hook
Created November 28, 2016 17:10
Add this to .git/hooks/pre-commit and make sure it's executable.
#!/bin/bash
# brew install clang-format
STYLE=$(git config --get hooks.clangformat.style)
if [ -n "${STYLE}" ] ; then
STYLEARG="-style=${STYLE}"
else
STYLEARG="-style=file"
fi
@karadza3a
karadza3a / Jupyter notebook
Created November 6, 2017 12:20 — forked from anonymous/Jupyter notebook
Processing BSON Files (Kaggle cdiscount competition)
import io
import bson # this is installed with the pymongo package
import matplotlib.pyplot as plt
import multiprocessing as mp # will come in handy due to the size of the data
from process import process
NCORE = 6
prod_to_category = mp.Manager().dict() # note the difference
@karadza3a
karadza3a / Base62.js
Last active February 24, 2019 23:59 — forked from alkaruno/Base64.js
Base62 encode & decode (alphanumeric only) in JavaScript
var Base62 = (function () {
var ALPHA = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
var Base62 = function () {};
var _encode = function (value) {
if (typeof(value) !== 'number') {
throw 'Value is not number!';