Skip to content

Instantly share code, notes, and snippets.

View transitive-bullshit's full-sized avatar
👋
Searching for AGI

Travis Fischer transitive-bullshit

👋
Searching for AGI
View GitHub Profile
const crypto = require('crypto')
const hash = (d) => {
const buffer = Buffer.isBuffer(d) ? d : Buffer.from(d.toString())
return crypto.createHash('sha256').update(buffer).digest('hex')
}
const hasha = require('hasha')
const hash = (input) => hasha(input, { algorithm: 'sha256' })
const pick = require('lodash.pick')
const stableStringify = require('fast-json-stable-stringify')
const data = pick(myData, ['keyFoo', 'keyBar'])
const fingerprint = hash(stableStringify(data))
@transitive-bullshit
transitive-bullshit / ghost-injection-head.html
Created September 6, 2019 20:37
Custom styles for self-hosted Ghost Blog
<style>
.gist {
width: 100%;
max-width: 680px;
}
.gist-file {
margin-bottom: 0 !important;
}
.gist + figcaption {
margin-top: 1em;
const isProd = (process.env.NODE_ENV === 'production')
/**
* Small utility for storing both live and test stripe IDs in a mongoose schema,
* but only publicly surfacing the active ID depending on the current
* environment.
*/
module.exports = (id, type = String, opts = { }) => {
const testId = `_${id}Test`
const liveId = `_${id}Live`
@transitive-bullshit
transitive-bullshit / .gitlab-ci.yml
Created June 19, 2019 18:20
GitLab CI Detox React Native Example
stages:
- E2E
.ios_base:
tags:
- macOS
- swiftlint
cache:
paths:
- node_modules
[
{
"url": "https://github.com/jlevy/the-art-of-command-line",
"userName": "jlevy",
"repoName": "the-art-of-command-line",
"desc": "Master the command line, in one page",
"numCommits": 1184,
"numIssues": 72,
"numPRs": 47,
"numProjects": 0,