Skip to content

Instantly share code, notes, and snippets.

@ondrek
ondrek / walk.js
Created January 6, 2014 21:44
Most elegant way of recursively get all files from folder
function walk(dir) {
var results = [];
fs.readdirSync(dir).forEach(function(file) {
file = dir+'/'+file;
var stat = fs.statSync(file);
if (stat && stat.isDirectory()) {
@ondrek
ondrek / walk.js
Created January 9, 2014 21:33
Walk recursivelly in NodeJs through all folders and subfolders and get all files
var _getFiles = function(dir) {
var results = [];
filesystem.readdirSync(dir).forEach(function(file) {
file = dir+'/'+file;
var stat = filesystem.statSync(file);
if (stat && stat.isDirectory()) {
@ondrek
ondrek / uniq-items-in-array.js
Created January 9, 2014 21:34
Remove from array all repeated items and return only uniq values in array
var _getUniqItemsFromArray = function(array){
var temp = {};
var uniqueArray = [];
for (var i = 0; i < array.length; i++) {
temp[array[i]] = true;
}
for (var k in temp) {
@ondrek
ondrek / fiddle.css
Last active January 3, 2016 05:59
JSFiddle Gist
canvas { margin: 20px; }
@ondrek
ondrek / gist:8537022
Created January 21, 2014 09:28
Leap Motion Code to listing in my book TurnJs with it
$(document).ready(function() {
var ctl = new Leap.Controller({enableGestures: true});
var swiper = ctl.gesture('swipe');
var totalDistance = 0;
var tolerance = 50;
var cooloff = 300;
@ondrek
ondrek / textcanvas.js
Created January 28, 2014 13:30
Canvas Implementation
goog.provide( "lib.display.CanvasText" );
goog.require( "lib.display.IDisplayObject" );
goog.require( "lib.display.CanvasSprite" );
goog.require( "goog.dom" );
goog.require( "goog.events.Event" );
goog.require( "goog.asserts" );
goog.require( "easy.data.domain.placeholder.font.FontStyle" );
goog.require( "goog.math.Coordinate" );
goog.require( "easy.data.domain.Color" );
http://www.marchettidesign.net/fullby/
http://www.eleventhemes.com/gridly/
http://themeforest.net/item/gridlocked-minimalistic-wordpress-portfolio-theme/full_screen_preview/245947?ref=cinim
http://themes.zeotheory.com/?theme=spaces
http://themeforest.net/item/hoarder-responsive-wordpress-blog-theme/full_screen_preview/2919551?ref=cinim
http://themeforest.net/item/gridnik-elite-portfolio-wordpress-theme/full_screen_preview/145673?ref=cinim
http://themeforest.net/item/quickly-handcrafted-wordpress-theme/full_screen_preview/4670677?ref=cinim
http://themeforest.net/item/dreame-responsive-wordpress-theme/full_screen_preview/5438510?ref=cinim
@ondrek
ondrek / test.txt
Last active August 29, 2015 13:56
skiing-logos.md
http://d13yacurqjgara.cloudfront.net/users/99244/screenshots/1143283/mountainlogo.png
http://d13yacurqjgara.cloudfront.net/users/3820/screenshots/806996/vintage_ski_patches.png
http://d13yacurqjgara.cloudfront.net/users/5531/screenshots/1285039/logo_gold_teaser.jpg
http://d13yacurqjgara.cloudfront.net/users/23979/screenshots/202998/planks_stack_teaser.jpg
http://d13yacurqjgara.cloudfront.net/users/60/screenshots/966935/check_these_logos.png
http://d13yacurqjgara.cloudfront.net/users/22136/screenshots/1332554/iis3_teaser.jpg
http://d13yacurqjgara.cloudfront.net/users/71149/screenshots/841887/dribbble-klondo_teaser.jpg
http://d13yacurqjgara.cloudfront.net/users/5772/screenshots/78763/shot_1289670195_teaser.jpg
http://d13yacurqjgara.cloudfront.net/users/3816/avatars/original/rally_logo.png?1358151861
http://d13yacurqjgara.cloudfront.net/users/3597/screenshots/900613/ski-close.png"
@ondrek
ondrek / themes.md
Created February 17, 2014 23:09
How to install mDown Boilerplates

How to install mDown Boilerplates

portfolio default theme

> git clone https://github.com/mdowndev/2014-portfolio
> cd 2014-portfolio
> mdown preview

blog default theme

@ondrek
ondrek / A.js
Last active August 29, 2015 13:56
Javascript Inheritance
Core = function(){};
Core.prototype.logger = function(arg){
console.log(+Date(), arg);
};