Skip to content

Instantly share code, notes, and snippets.

View velocityzen's full-sized avatar
🚲
Inventing

Alexey Novikov velocityzen

🚲
Inventing
View GitHub Profile
#include <vector>
#include <iostream>
#include <cmath>
using namespace std;
#define EPSILON 1.0e-5
#define RESOLUTION 32
class Point2D
@velocityzen
velocityzen / cookie.js
Created December 19, 2012 10:57
LocalStorage cookie emulation for using in iframes for example.
.font (@font-name, @font-file, @font-weight: normal, @font-style: normal) {
@font-face {
font-family: @font-name;
src:url('../fonts/@{font-file}.woff2') format('woff2'),
url('../fonts/@{font-file}.woff') format('woff'),
url('../fonts/@{font-file}.ttf') format('truetype');
font-weight: @font-weight;
font-style: @font-style;
}
}
@velocityzen
velocityzen / puller
Created October 22, 2013 09:39
git pull in all sub directories. good for refreshing big projects.
#!/bin/bash
current_dir=`pwd`/
dir=$current_dir
usage="Usage : `basename $0` [-d dir] [-h] args\nWhere args are directories that you don't whant to pull"
while getopts hd: opt; do
case $opt in
d)
if [ ! -d $OPTARG ] ; then
@velocityzen
velocityzen / auth.py
Created September 26, 2011 16:30
This script take pictures from directory and post it to tumblr blog and then delete it. Tumblr API v2! This example for oath file upload.
import urlparse
import oauth2 as oauth
consumer_key = ''
consumer_secret = ''
request_token_url = 'http://www.tumblr.com/oauth/request_token'
access_token_url = 'http://www.tumblr.com/oauth/access_token'
authorize_url = 'http://www.tumblr.com/oauth/authorize'