In this talk we will be all discussing the origin of the furry fandom. How we will thogheter create a new furry-in-js framework. We will going over how they have changed the current fandom world, our hearts and the js world in 5 very awesome minutes! This talk is to prove a point that stars mean nothing in this case.
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
// pack bytes into valid UTF-16 string | |
// | |
// strategy: | |
// | |
// * using ESC as the escape character | |
// * if there is ESC in the bytes, double it | |
// * if there is unmatched surrogate pair, mark it by the escape character | |
// | |
// 0x007f: escape, because it's rare but still only one utf-8 byte. | |
// To escape itself, use 0x007f 0x08ff (two bytes utf-8) |
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 bash | |
# | |
# This script wraps a command with a read lock on given SQLite databases | |
# Example: wrap-sqlite-backup.sh *.sqlite3 -- tar cvzf backup.tgz *.sqlite3 | |
# | |
# Note that it doesn't check for errors, so it really only works in WAL mode. | |
# Updates that read from ${COPROC[0]} to check errors welcome. | |
# | |
# [email protected] | |
# https://gist.github.com/wmertens/4df207197074f9cb93f003c1cb723b4c |
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
// Require this in your program, or load it with node's -r flag | |
const Mod = require('module') | |
const req = Mod.prototype.require | |
let indent = '' | |
const rootRE = new RegExp(process.cwd(), 'g') | |
const stack = [] | |
Mod.prototype.require = function() { | |
try { | |
const request = arguments[0] |
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 bash | |
# | |
# ssh-crypt | |
# | |
# Bash function to encrypt/decrypt with your ssh-agent private key. | |
# Requires the commands gzip, ssh-add, ssh-keygen and openssl. | |
# | |
# Uses bash-specific extensions like <<<$var to securely pass data. | |
# | |
# [email protected] 2021-11-11 - MIT Licensed |
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
import React, {createContext, useContext, useRef} from 'react' | |
import PropTypes from 'prop-types' | |
const Id = createContext() | |
const useIdGetter = (prefix = 'id') => { | |
const ref = useRef() | |
if (!ref.current) { | |
const me = {id: 0, get: () => `${prefix}-${me.id++}`} | |
ref.current = me |
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
import DataLoader from 'dataloader' | |
import {graphqlExpress} from 'graphql-server-express' | |
import schema from './schema' | |
import db from './database' | |
const contextFromReq = req => { | |
const {session} = req | |
const loaders = {} | |
const getLoader = (id, makeGetter) => { |
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 function withMutation({name, args}) { | |
let mutation; | |
if (args) { | |
const args1 = _.map(args, (type, name) => `$${name}: ${type}`); // e.g. $url: String | |
const args2 = _.map(args, (type, name) => `${name}: $${name}`); // e.g. $url: url | |
mutation = ` | |
mutation ${name}(${args1}) { | |
${name}(${args2}) |
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
import React, {Component, PropTypes} from 'react' | |
import {Link, Route as OrigRoute, Switch, Redirect, BrowserRouter as Router, withRouter} from 'react-router-dom' | |
// Subscribes a child to history updates, passing the current location as a prop | |
// This is needed to work around the React context API not updating all children | |
// See https://github.com/ReactTraining/react-router/issues/4629#issuecomment-284218493 | |
export class LocationListener extends Component { | |
static contextTypes = { | |
history: PropTypes.object, | |
} |
NewerOlder