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
@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;
@nikibobi
nikibobi / extract.js
Created March 11, 2017 20:00
Extract PoE currency prices from http://poe.ninja/challenge/currency
$('tr td:nth-child(3) .currency-amount')
.toArray()
.map(v => $(v).text().slice(0, -3))
.map(Number)
@nikibobi
nikibobi / regression.ipynb
Created March 18, 2017 18:16
Linear Regression example with scikit-learn
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nikibobi
nikibobi / pacboy.c
Last active April 15, 2017 20:04
minimalistic arch package manager
#include <stdio.h>
#include <stdlib.h>
#include <alpm.h>
#include <alpm_list.h>
int main(void) {
alpm_errno_t *err;
alpm_handle_t *alpm = alpm_initialize("/", "/var/lib/pacman/", err);
#include <RCSwitch.h>
#define PIN 2
RCSwitch rc = RCSwitch();
void setup() {
Serial.begin(9600);
rc.enableReceive(digitalPinToInterrupt(PIN));
}
#ifdef GL_FRAGMENT_PRECISION_HIGH
precision highp float;
#else
precision mediump float;
#endif
uniform vec2 resolution;
uniform int pointerCount;
uniform vec3 pointers[10];
uniform float battery;
@nikibobi
nikibobi / GithubRibbon.vue
Last active November 23, 2018 09:04
Github ribbon vue.js component
<template>
<a :href="link">
<img :src="image" :style="{ [this.orientation]: 0 }" alt="Fork me on GitHub">
</a>
</template>
<script lang="ts">
import { Component, Prop, Vue } from 'vue-property-decorator';
const palete = {
[
{
"distance": 79,
"name": "Policeman Monument",
"bearing": 84,
"latitude": 43.84599,
"image": "http://lh4.ggpht.com/pxXhWO9N2P06hsXgKABdT7MasbF6Rdv37bhJswycH4ELhE3_eZ58omN0cbmf3UBT17Vq1mlG49J-OehrL5a4eA",
"guid": "d407c66b765a4839ae04fd0c3f6d0539.16",
"compass": "E",
"longitude": 25.959249
@nikibobi
nikibobi / pg-pong.py
Created July 27, 2018 21:05 — forked from karpathy/pg-pong.py
Training a Neural Network ATARI Pong agent with Policy Gradients from raw pixels
""" Trains an agent with (stochastic) Policy Gradients on Pong. Uses OpenAI Gym. """
import numpy as np
import cPickle as pickle
import gym
# hyperparameters
H = 200 # number of hidden layer neurons
batch_size = 10 # every how many episodes to do a param update?
learning_rate = 1e-4
gamma = 0.99 # discount factor for reward