Skip to content

Instantly share code, notes, and snippets.

View Restuta's full-sized avatar
🦄
Hacking fast and slow.

Anton Vynogradenko Restuta

🦄
Hacking fast and slow.
View GitHub Profile
@Restuta
Restuta / .block
Last active December 26, 2016 05:07
Force-Directed Graph
license: gpl-3.0
height: 600
@Restuta
Restuta / .block
Created December 26, 2016 04:52
Force-Directed Graph
license: gpl-3.0
height: 600
@Restuta
Restuta / .block
Created December 26, 2016 04:42
Directional Force Layout Diagram with node colouring
license: mit
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace RobotConsole
{
/*
@Restuta
Restuta / cat-is-alive.js
Last active November 12, 2016 02:09
Cat is alive
var catIsAlive = catOnMars.isAlive(); //very expensive operation to check if cat is alive on Mars, we don't want to perform it twice
reportCatStatus({ catIsAlive })
if (catIsAlive) {
doOtherStuff();
}}
// below is for twitter discussion, ignore it if you don't know what is it about
@Restuta
Restuta / wget.sh
Created November 1, 2016 18:20
wget commands to get static sites
# gets 1-level up page, good for downloading static home-page
wget --no-cookies --timestamping --recursive --level=1 --convert-links --no-parent --page-requisites --adjust-extension --max-redirect=0 [url]
[TestMethod]
public void Paradox() {
Box box = new Box(new FlaskWithPoison(), new RadioactiveSource());
Cat cat = new Cat();
box.put(cat); //poor kitty
box.close();
Assert.IsTrue(cat.IsAlive);
Assert.IsTrue(cat.IsDead);
}
@Restuta
Restuta / ncnca-total-vs-canceled.js
Last active August 28, 2016 22:50
NCNCA Total Events vs Canceled 2011-2016
[{ "2011": 0.03625377643504532,
totalEvents: 331,
totalCanceled: 12 },
{ "2012": 0.04746835443037975,
totalEvents: 316,
totalCanceled: 15 },
{ "2013": 0.03806228373702422,
totalEvents: 289,
totalCanceled: 11 },
{ "2014": 0.05555555555555555,
/** @flow */
import Immutable from 'immutable'
import { createSelector } from 'reselect'
const LOCAL_STORAGE_KEY = 'LocalStorageModule'
const ACTION_TYPES = {
REMOVE: 'REMOVE_ACTION',
SET: 'SET_ACTION'
}
@Restuta
Restuta / framework-sizes.md
Last active June 11, 2025 03:17
Sizes of JS frameworks, just minified + minified and gzipped, (React, Angular 2, Vue, Ember)

Below is the list of modern JS frameworks and almost frameworks – React, Vue, Angular, Ember and others.

All files were downloaded from https://cdnjs.com and named accordingly. Output from ls command is stripped out (irrelevant stuff)

As-is (minified)

$ ls -lhS
566K Jan 4 22:03 angular2.min.js