Skip to content

Instantly share code, notes, and snippets.

View robherley's full-sized avatar
curl tiny.coffee

Rob Herley robherley

curl tiny.coffee
View GitHub Profile
@robherley
robherley / euler13.js
Last active January 25, 2018 22:23
Node.js Solution to Project Euler #13
const fs = require('fs');
const readInt8 = () =>
new Promise((resolve, reject) => {
fs.readFile('input.txt', 'utf8', (err, data) => {
let newData = data
.split(/\n/g)
.map(e => new Int8Array(e.match(/./g).map(e => parseInt(e))));
err ? reject(err) : resolve(newData);
});
const MOD = 1000000007;
const samSubstr = balls =>
[...balls].reduceRight(
(prev, digit, i) => {
return [
(prev[0] * 10 + 1) % MOD,
(prev[1] + ~~digit * prev[0] * (i + 1)) % MOD
];
},
[1, 0]
set number
set relativenumber
set smartindent
set showcmd
set expandtab
set tabstop=4
set softtabstop=4
set shiftwidth=4
4981785 4 -rw-rw-r-- 1 rob rob 2 Apr 19 18:46 ./smol_boye.txt
4981785 4 -rw-rw-r-- 1 rob rob 4 Apr 19 18:46 ./one_block.txt
4981785 4 -rw-rw-r-- 1 rob rob 15 Apr 19 18:46 ./top_level_file.txt
4981784 4 -rw-rw-r-- 1 rob rob 17 Apr 19 18:45 ./a/b/c/d/d_child.txt
4981783 4 -rw-rw-r-- 1 rob rob 5 Apr 19 18:45 ./a/b/b_child.txt
4981782 4 -rw-rw-r-- 1 rob rob 19 Apr 19 18:44 ./xyz/dank_meme.png
./
./a
./a/b
./a/b/c
./a/b/c/d
./a/b/c/d/e
./xyz
/**
* Simple Example Communications over Bluetooth using HC-05 Module
*
* Here's an example of the wiring diagram: https://goo.gl/qctNCN
*
* Desktop (thru Arduino IDE)
* - Connect to HC-05 in bluetooth settings
* - Change Port in Tools -> Port to /dev/...HC-05 (NOT the Arduino Port)
* - Open the Serial Monitor (make sure baud rate is 9600)
* - Now you can send the single char commands through there
# PATH
path+=(
$HOME/bin
/usr/local/bin
$HOME/go/bin
/usr/local/opt/go/libexec/bin
/usr/local/opt/qt/bin
/usr/local/mysql/bin
/usr/local/opt/python@2/libexec/bin:/usr/local/opt/python@2/bin
)
set number
set relativenumber
set smartindent
set showcmd
set expandtab
set tabstop=4
set softtabstop=4
set shiftwidth=4
#!/bin/bash
echo "Howdy, what folder do you want to serve assets from?"
echo -n ">"
read foldrdir
echo "Okay, I'll read from $foldrdir. What do you want to name the container?"
echo -n ">"
read container
const { execSync } = require('child_process');
const modes = ['ECB', 'CBC', 'OFB', 'PCBC'];
const stuff = [
{
type: 'DES',
sizes: ['56'],
modes
},
{