This file contains hidden or 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
terraform { | |
required_providers { | |
aws = { | |
source = "hashicorp/aws" | |
version = "~> 4.16" | |
} | |
} | |
required_version = ">= 1.2.0" | |
} |
This file contains hidden or 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
{application, cdash, | |
[{description, "Dashboard for something"}, | |
{vsn, "0.1.0"}, | |
{registered, []}, | |
{applications, | |
[kernel, | |
stdlib, | |
cecho, | |
inets | |
]}, |
This file contains hidden or 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
from contextlib import contextmanager | |
import libevdev | |
from periphery import GPIO | |
import time | |
# 230 69 73 80 | |
gpio_out1 = GPIO("/dev/gpiochip0", 230, "out") | |
gpio_out2 = GPIO("/dev/gpiochip0", 69, "out") | |
gpio_out3 = GPIO("/dev/gpiochip0", 73, "out") |
This file contains hidden or 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
import { computed, readonly, reactive, ref, watch } from 'vue' | |
function spawn(fn, pname, toParent = ()=> null) { | |
let current = null; | |
let state = reactive({}); | |
let buffer = []; | |
let resolveExit; | |
let exitPromise = new Promise(resolve => { | |
resolveExit = resolve; | |
}); |
This file contains hidden or 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 spawn(fn, pname, toParent = ()=> null) { | |
let current = null; | |
let state = null; | |
function getState() { | |
return state; | |
}; | |
let listeners = []; | |
let buffer = []; | |
function subscribe(fn) { | |
listeners.push(fn); |
This file contains hidden or 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
from datetime import date | |
import json | |
import re | |
from collections import namedtuple | |
def make_date(date_str): | |
[day, month, year] = date_str.split('.') | |
return date(day=int(day), month=int(month), year=int(year)) | |
This file contains hidden or 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
import wcurve | |
import hashlib | |
def inverse_mod(a, m): | |
"""Inverse of a mod m.""" | |
if a < 0 or m <= a: | |
a = a % m | |
# From Ferguson and Schneier, roughly: |
This file contains hidden or 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
describe('Jest', ()=> { | |
it('what', (done)=> { | |
Promise.resolve().then(()=> { | |
throw new Error('ya yaya'); | |
}).then(done, done); | |
}) | |
it('okay', ()=> { | |
return Promise.resolve().then(()=> { | |
throw new Error('ya yaya'); |
This file contains hidden or 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
from threading import Thread, current_thread, local | |
def thread(): | |
other = current_thread() | |
local().name = 'WHAT?' | |
print 'generator hijack', next(gen) | |
def where_am_i(): | |
for x in range(10): |
This file contains hidden or 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
import React from 'react'; | |
class Inside extends React.Component { | |
static contextTypes = { | |
section: React.PropTypes.string, | |
}; | |
render() { | |
return (<span>INSIDE {this.context.section}</span>); | |
} |
NewerOlder