Skip to content

Instantly share code, notes, and snippets.

View nikibobi's full-sized avatar
📈
The future belongs to the people that turn data into products

Borislav Kosharov nikibobi

📈
The future belongs to the people that turn data into products
View GitHub Profile
#define STEPS 800 //motor steps for one cut
#define DIRECTION 1 //motor direction 1 or 0
#define CUT_TIME 500 //time to cut in ms
#define CUT_COUNT 20 //number of cuts
#define SPEED_TIME 1 //speed between impulses in ms
#define PAUSE_TIME 100 //time after pause button is pressed
#define GRAB_TIME 200 //time for grabbing/releasing the paperj
#define STEP_PIN 5 //motor driver STEP pin
#define DIR_PIN 11 //motor driver DIR pin
@nikibobi
nikibobi / MiniJSON.cs
Last active December 15, 2015 22:08 — forked from darktable/MiniJSON.cs
MiniJSON
/*
* Copyright (c) 2012 Calvin Rien
*
* Based on the JSON parser by Patrick van Bergen
* http://techblog.procurios.nl/k/618/news/view/14605/14863/How-do-I-write-my-own-parser-for-JSON.html
*
* Simplified it so that it doesn't throw exceptions
* and can be used in Unity iPhone with maximum code stripping.
*
* Permission is hereby granted, free of charge, to any person obtaining
@nikibobi
nikibobi / preferences.json
Last active December 18, 2015 05:49
Sublime Text 2 preferences
{
"color_scheme": "Packages/Color Schemes by carlcalderon/Stereokai/Stereokai.tmTheme",
"font_face": "Monaco",
"font_size": 16,
"translate_tabs_to_spaces": true,
"use_tab_stops": false
}
@nikibobi
nikibobi / nigga.d
Last active December 20, 2015 17:29
nigga
module nigga;
import std.algorithm : reduce;
import std.conv : to;
import std.process : browse;
import std.stdio : write, writeln, readln;
import std.string : toLower, capitalize, toUpper;
void main() {
"http://www.youtube.com/watch?v=0itOCgJtNVU".browse;
@nikibobi
nikibobi / init.d
Created August 7, 2013 20:20
init.d
///This is only for debug. The same role as Type.init == init!Type
@property auto init(Target)() {
writeln(Target.init); //used for debug
return Target.init;
}
///Returns Source's .init converted with std.conv.to to Target
@property auto init(Source, Target)() {
return init!Source.to!Target;
}
@nikibobi
nikibobi / argnull.d
Created August 7, 2013 21:54
argnull.d
import std.string : format;
///Use with mixins. mixin(ArgNull!<arg>);
template ArgNull(alias argument) {
enum ArgNull = format(
"if(%1$s is null)
throw new Exception(\"%1$s cannot be null.\");", argument.stringof);
}
unittest {
@nikibobi
nikibobi / bosakkoshi.css
Last active December 21, 2015 23:38
Tumblr blog stylesheet
/*links*/
a {
text-decoration: none;
}
a:hover {
color: #ffff00;
}
a:active {
@nikibobi
nikibobi / cases.fs
Last active June 7, 2016 12:06
Get a seq of all the cases of union type in F#
open Microsoft.FSharp.Reflection
let cases<'a> = seq {
for case in FSharpType.GetUnionCases typeof<'a> do
yield (FSharpValue.MakeUnion(case, [||]) :?> 'a)
}
@nikibobi
nikibobi / PairHeap.fs
Created August 3, 2016 08:57
F# pairing heap implementation
module PairHeap
type Heap<'a> =
| Empty
| Heap of 'a * (Heap<'a> list)
let top =
function
| Empty -> failwith "empty"
| Heap (c,_) -> c
@nikibobi
nikibobi / app.js
Created November 10, 2016 15:25
JS Advanced Homework
import { Turtle } from './turtle.js';
import { WaterTurtle } from './water.js';
import { GalapagosTurtle } from './galapagus.js';
import { EvkodianTurtle } from './evkodian.js';
import { NinjaTurtle } from './ninja.js';
result.Turtle = Turtle;
result.WaterTurtle = WaterTurtle;
result.GalapagosTurtle = GalapagosTurtle;
result.EvkodianTurtle = EvkodianTurtle;