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
#! /usr/bin/env python | |
#define acceptable input | |
rna = ['a','u','g','c','A','U','G','C',] | |
boxb = 'CCGGGAAAAAGUCCCGG' | |
#convert t to u | |
def makerna(seq): | |
for x in range(len(seq)): |
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 decrypt(text) { | |
const [ivStr, encodedStr] = text.split(':') | |
const initVector = new Buffer(ivStr, 'base64'); | |
const decipher = crypto.createDecipheriv( | |
'aes-256-cbc', CRYPTO_KEY, initVector | |
); | |
const encrypted = new Buffer(encodedStr, 'base64'); | |
let decrypted = Buffer.concat( | |
[decipher.update(encrypted), decipher.final()] | |
); |
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
var crypto = require('crypto'); | |
const CRYPTO_KEY = 'ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ'; // Must be 256 bytes (32 characters) | |
const message = `I see a little silhouetto of a man, | |
Scaramouch, scaramouch will you do the fandango, | |
Thunderbolt and lightning very very frightening me, | |
Gallileo, Gallileo, | |
Gallileo, Gallileo, | |
Gallileo Figaro - magnifico` |
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
{ | |
"atomKeymap.promptV3Features": true, | |
"editor.multiCursorModifier": "ctrlCmd", | |
"editor.fontSize": 18, | |
"editor.lineHeight": 22, | |
"editor.fontWeight": "300", | |
"editor.fontFamily": "Iosevka", | |
// "editor.fontFamily": "Office Code Pro Medium", | |
//"editor.fontFamily": "Office Code Pro", |
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 reverseList(input, accumulator) { | |
var reversed = { | |
id: input.id, | |
next: accumulator || null | |
}; | |
return input.next | |
? reverseList(input.next, reversed) | |
: reversed; | |
} |
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 nums(n = 1) { | |
return { first: n, rest: () => nums(n + 1) }; | |
} | |
nums().first; // => 1 | |
function take(stream, n) { | |
if (n <= 0) return []; | |
else { | |
const { first, rest } = stream(); |
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
// Identity functor | |
const Box = x => ({ | |
map: f => Box(f(x)), | |
fold: f => f(x), | |
inspect: () => `Box(${x})` | |
}); | |
// const Either = Right || Left | |
const Right = x => ({ |
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
export default class PersistentObject { | |
constructor(name, contents) { | |
this._validateContents(contents); | |
this.name = name; | |
this.contents = contents; | |
} | |
set(contents) { | |
this.contents = { ...contents }; | |
localStorage.setItem(this.name, this.contents); |
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
// from this excellent tutorial on decorators: | |
// https://javascript.info/call-apply-decorators | |
let worker = { | |
slow(min, max) { | |
alert(`Called with ${min},${max}`); | |
return min + max; | |
} | |
}; |
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
@startuml | |
' Basic styles that improve on defaults | |
skinparam BackgroundColor Bisque | |
skinparam NoteBorderColor DeepSkyBlue | |
skinparam ArrowColor Navy | |
skinparam Default { | |
FontName Consolas | |
FontSize 16 | |
} | |
skinparam Title { |
OlderNewer