Skip to content

Instantly share code, notes, and snippets.

💭
is listening to "Forty Six & Two" by Tool

Josh Perez goatslacker

Block or report user

Report or block goatslacker

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View draftPicks.ts
import * as sql from "sqlite";
import * as Discord from "discord.js";
import getL10nFunction from "./src/constants/messages";
const ROUNDS = 10;
// TODO configurable
const L10n = getL10nFunction("EN");
async function getDB(): Promise<sql.Database> {
const db = await sql.open("./pokedraft.sqlite");
View keybase.md

Keybase proof

I hereby claim:

  • I am goatslacker on github.
  • I am goatslacker (https://keybase.io/goatslacker) on keybase.
  • I have a public key ASD-2-2QhDQGJttBzY79_etlXj_Ct_OdvEVgVhQ3uhirkwo

To claim this, I am signing this object:

View applyGlobalMiddleware.js
const {
applyMiddleware,
} = require('redux')
function applyGlobalMiddleware(...globalMiddlewares) {
return createStore => (reducer, preloadedState, enhancer) => {
const scopedMiddleware = []
const injectableMiddleware = store => next => action => {
const chain = scopedMiddleware.map(m => m(store))
View injectableMiddleware.js
import { createStore, compose, applyMiddleware } from 'redux'
export default function createInjectableStore(reducers, preloadedState, enhancer) {
const injectedMiddleware = []
const injectableMiddleware = store => next => action => {
const chain = injectedMiddleware.map(m => m(store))
const dispatchThroughMiddleware = chain.reduceRight((next, f) => {
return f(next)
}, action => next(action))
View levels.py
import math
pokemon = {
"bulbasaur":{"stamina":90,"attack":118,"defense":118},
"ivysaur":{"stamina":120,"attack":151,"defense":151},
"venusaur":{"stamina":160,"attack":198,"defense":198},
"charmander":{"stamina":78,"attack":116,"defense":96},
"charmeleon":{"stamina":116,"attack":158,"defense":129},
"charizard":{"stamina":156,"attack":223,"defense":176},
"squirtle":{"stamina":88,"attack":94,"defense":122},
View pogo_cp_calc.py
import math
pokemon = {
"bulbasaur":{"stamina":90,"attack":118,"defense":118},
"ivysaur":{"stamina":120,"attack":151,"defense":151},
"venusaur":{"stamina":160,"attack":198,"defense":198},
"charmander":{"stamina":78,"attack":116,"defense":96},
"charmeleon":{"stamina":116,"attack":158,"defense":129},
"charizard":{"stamina":156,"attack":223,"defense":176},
"squirtle":{"stamina":88,"attack":94,"defense":122},
View gist:9cc8a5a84991cb4b2f78d88929a3f1ca
[
{
"id": 1,
"name": "BULBASAUR",
"type1": "GRASS",
"type2": "POISON",
"stats": {
"stamina": 90,
"attack": 118,
"defense": 118
@goatslacker
goatslacker / bench-react.js
Created Oct 10, 2016
Benchmarking React with different variances like props, components, markup size, etc
View bench-react.js
const Benchmark = require('benchmark');
const React = require('react/dist/react.min');
const ReactDOMServer = require('react-dom/dist/react-dom-server.min');
const suite = new Benchmark.Suite();
// ==========================================================================
// LotsOfBytes test:
// > A metric shit ton of markup output by a single React element.
View ifixeditforjordan.js
function Matchup(props) {
const matchups = props.name ? idealMatchup.overall(props.name) : []
return (
$(B.View, [
$(B.Header, 'Ideal Matchup'),
$(B.Text, 'This is calculated based on the opposing Pokemon\'s type and assuming the opponent has the best possible moveset combination for their Pokemon. The results do not include legendaries. Pokemon type effectiveness and resistances are also taken into account.'),
$('hr'),
$(FormPokemonName, { name: props.name }),
matchups.length ? (
$(B.Table, {
View style-guides-are-useless-right.js
[][(![]+[])[!+[]+!![]+!![]]+([]+{})[+!![]]+(!![]+[])[+!![]]+(!![]+[])[+[]]][([]+{})[!+[]+!![]+!![]+!![]+!![]]+([]+{})[+!![]]+([][[]]+[])[+!![]]+(![]+[])[!+[]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+{})[!+[]+!![]+!![]+!![]+!![]]+(!![]+[])[+[]]+([]+{})[+!![]]+(!![]+[])[+!![]]](([]+{})[!+[]+!![]+!![]+!![]+!![]]+([]+{})[+!![]]+([][[]]+[])[+!![]]+(![]+[])[!+[]+!![]+!![]]+([]+{})[+!![]]+(![]+[])[!+[]+!![]]+([][[]]+[])[!+[]+!![]+!![]]+[][(![]+[])[!+[]+!![]+!![]]+([]+{})[+!![]]+(!![]+[])[+!![]]+(!![]+[])[+[]]][([]+{})[!+[]+!![]+!![]+!![]+!![]]+([]+{})[+!![]]+([][[]]+[])[+!![]]+(![]+[])[!+[]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+{})[!+[]+!![]+!![]+!![]+!![]]+(!![]+[])[+[]]+([]+{})[+!![]]+(!![]+[])[+!![]]]((!![]+[])[+!![]]+([][[]]+[])[!+[]+!![]+!![]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+!![]]+([]+{})[!+[]+!![]+!![]+!![]+!![]+!![]+!![]]+([][[]]+[])[+[]]+([][[]]+[])[+!![]]+([][[]]+[])[!+[]+!![]+!![]]+(![]+[])[!+[]+!![]+!![]]+([]+{})[!+[]+!![]+!![]
You can’t perform that action at this time.