Skip to content

Instantly share code, notes, and snippets.

Avatar

brian harrison idiomatic

  • portland, oregon
View GitHub Profile
We couldn’t find that file to show.
View .bash_profile
export HISTFILESIZE=10000
export SAVEHIST=10000
if [ -e $HOME/bin ]
then
export PATH=$PATH:$HOME/bin
fi
if which -s node
then
View RULES.md

Vanilla "Project 60" Rules

Races

Only races that were available in Vanilla.

No Pandaren [else warning].

No Worgen [else warning].

View deno http server api snippets.md

Legacy Node.js

const http = require('http');
const https = require('https');
const http2 = require('http2');
const s = http.createServer((req, res) => { });
s.listen(PORT, ADDRESS);
const options = {key: KEY, cert: CERT};
const stls = https.createServer(options, (req, res) => { });
@idiomatic
idiomatic / farmables.sql
Last active Dec 6, 2017
find things to farm in a classic WoW db, that drop "medium rarely" from few world mob types with longer average spawn durations
View farmables.sql
SELECT item.*,
CAST(oclt.ChanceOrQuestChance AS DECIMAL(6, 2)) as Chance,
COUNT(*) AS Spawns,
oct.entry as Creature,
oct.Name as `Creature Name`,
CAST(AVG(oc.SpawnTimeSecs) AS DECIMAL(6, 0)) AS `Spawn Time`
FROM (
SELECT i.*, COUNT(*) AS `Creature Types`
FROM (
SELECT iclt.item AS Item,
@idiomatic
idiomatic / islands.js
Last active Dec 6, 2017
count the number of "islands" in an matrix of non-wraparound bits, where horizontally/vertically/diagonally adjacent bits are the same island
View islands.js
const tests = [
[0, [[0]]],
[1, [[1]]],
[1, [[1, 0], [0, 0]]],
[1, [[0, 1], [0, 0]]],
[1, [[0, 0], [1, 0]]],
[1, [[0, 0], [0, 1]]],
[1, [[1, 0], [0, 1]]],
[1, [[0, 1], [0, 1]]],
[1, [[1, 0], [1, 0]]],
View methodmux.go
package main
import (
"io"
"log"
"net/http"
)
type MethodMux struct {
GET http.Handler
View react_native_index.ios.coffee
###
# Sample React Native App
# https://github.com/facebook/react-native
###
'use strict'
React = require 'react-native'
{AppRegistry, StyleSheet, Text, View} = React
CoffeeProject = React.createClass
@idiomatic
idiomatic / !rclone-pretty.sh
Last active Aug 29, 2015
rclone output polish
View !rclone-pretty.sh
#!/bin/sh
# TODO: output checking
fix_rclone_output() {
perl -ne '
BEGIN {
$|++;
sub human {
my ($size) = @_;
View longestIncreasingSubsequence.coffee
longestIncreasingSubsequence = (sequence) ->
startIndex = []
endIndex = []
subsequences = []
for value, i in sequence
for length in [endIndex.length..0] by -1
if (sequence[endIndex[length - 1]] ? Number.MIN_VALUE) < value < (sequence[endIndex[length]] ? Number.MAX_VALUE)
endIndex[length] = i
startIndex[length] = startIndex[length - 1] ? i
You can’t perform that action at this time.