This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
contract; | |
abi ProxyAbi { | |
#[storage(read)] | |
fn read_val() -> u64; | |
#[storage(write)] | |
fn write_target(target: ContractId); | |
} | |
#[namespace(proxy_47892374)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Easing Functions - inspired from http://gizma.com/easing/ | |
* only considering the t value for the range [0, 1] => [0, 1] | |
*/ | |
EasingFunctions = { | |
// no easing, no acceleration | |
linear: function (t) { return t }, | |
// accelerating from zero velocity | |
easeInQuad: function (t) { return t*t }, | |
// decelerating to zero velocity |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const DemoData = { | |
resources: [{ | |
id: 'r1', | |
name: 'Interventions' | |
}], | |
events: [{ | |
"id": 15, | |
"start": "2018-07-05T07:00:00Z", | |
"end": "2018-07-05T08:00:00.000Z", | |
"resourceId": "r1", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function stockPicker(market) { | |
let lowest_index = 0; | |
const lowest_previous_index = market.map((x, i) => { | |
if (x < market[lowest_index]) { | |
lowest_index = i; | |
} | |
return lowest_index; | |
}); | |
let best = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs'); | |
const englishFrequency = [ | |
0.08167, | |
0.01492, | |
0.02782, | |
0.04253, | |
0.12702, | |
0.02228, | |
0.02015, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::env; | |
use std::io::Read; | |
use std::fs::File; | |
use std::cmp; | |
pub fn main() { | |
let args: Vec<String> = env::args().collect(); | |
let mut file = File::open(&args[1]).unwrap(); | |
let mut contents = String::new(); | |
file.read_to_string(&mut contents).unwrap(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <string.h> | |
#include "term.h" | |
/* Eterm */ | |
static const char *Eterm_keys[] = { | |
"\033[11~","\033[12~","\033[13~","\033[14~","\033[15~","\033[17~","\033[18~","\033[19~","\033[20~","\033[21~","\033[23~","\033[24~","\033[2~","\033[3~","\033[7~","\033[8~","\033[5~","\033[6~","\033[A","\033[B","\033[D","\033[C", 0 | |
}; | |
static const char *Eterm_funcs[] = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const qr = require('qrcode'); | |
const Canvas = require('drawille'); | |
qr.drawBitArray(process.argv[2], (err,bits,width) => { | |
if(err){ | |
console.error(err); | |
return; | |
} | |
let height = Math.ceil(bits.length / width); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <algorithm> | |
#include <iostream> | |
#include <map> | |
#include <string> | |
#include <utility> | |
#include <vector> | |
namespace { | |
using Iter = std::string::const_iterator; |
NewerOlder