Skip to content

Instantly share code, notes, and snippets.

View 1tgr's full-sized avatar
💬
Loading...

Tim Robinson 1tgr

💬
Loading...
View GitHub Profile
// https://play.elevatorsaga.com
{
init: function(elevators, floors) {
function anyoneWaiting(e) {
var c = e.currentFloor();
var dest = _.head(e.destinationQueue);
var bs = floors[c].buttonStates;
if (dest === undefined || dest == c)
return !!bs.up || !!bs.down;
use nalgebra::allocator::Allocator;
use nalgebra::{DefaultAllocator, Dim, MatrixMN, RowVectorN, Scalar, VectorN, U1};
use num_traits::identities::Zero;
pub trait IteratorExt: Iterator + Sized {
fn collect_columns<N, R, C>(self) -> MatrixMN<N, R, C>
where
Self: Iterator<Item = VectorN<N, R>>,
N: Scalar + Zero,
R: Dim,
[package]
name = "temp"
version = "0.1.0"
authors = ["Tim Robinson"]
edition = "2018"
enum Product {
"BTC-EUR",
"ETH-EUR",
"ETH-BTC",
}
let p: Product = Product!("BTC-EUR");
mod product {
struct "BTC-EUR";
{
"name": "portfolio-app",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"build": "node_modules/.bin/webpack --progress --profile --colors",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
import random
import time
from concurrent import futures
from concurrent.futures import ThreadPoolExecutor
from tqdm import tqdm
def run(task_num):
with tqdm(range(100), desc='Task %d' % task_num, position=task_num) as progress:
for _ in progress:
@1tgr
1tgr / ko-dict.js
Last active February 14, 2018 17:44
ko = require('knockout');
ko.observableDictionary = function(dict, valueFn) {
if (!valueFn) {
valueFn = function() {
return ko.observable();
};
}
var viewModels = {};
@1tgr
1tgr / Demo.exe
Last active December 24, 2015 06:19
Hindley-Milner type inference
@1tgr
1tgr / .gitignore
Last active December 20, 2015 15:28 — forked from anonymous/Program.fs
Computed observable
*.userprefs
bin/
obj/