Skip to content

Instantly share code, notes, and snippets.


Jared Reich jaredreich

View GitHub Profile
ww9 /
Last active Jul 8, 2020
Using Gist as a blog #blog

Blogging with Gist

Gist simplicity can turn blogging into a liberating experience.

Pros Cons
Free, simple, fast, hassle-free Image upload in comments only
Tagging No post pinning
Search Doesn't look like a blog
Revisions Unfriendly URLs
getify / 1.js
Last active Apr 28, 2020
demonstrating how to use "nodegit" to modify and read from a local bare git repo
View 1.js
NOTE: This code assumes a bare git repo in ./bare-git/,
which should have at least one text file in its root,
named "greetings.txt".
This code updates the contents of a "greetings.txt"
file, and creates a new file called "greetings-XXX.txt"
(with XXX being a random number). It then creates a new
commit for these changes. Finally, it reads and dumps
the new current contents of the repo, file by file.
ziluvatar / token-generator.js
Last active Aug 12, 2020
Example of refreshing tokens with jwt
View token-generator.js
* Example to refresh tokens using
* It was requested to be introduced at as part of the jsonwebtoken library,
* since we feel it does not add too much value but it will add code to mantain
* we won't include it.
* I create this gist just to help those who want to auto-refresh JWTs.
const jwt = require('jsonwebtoken');
lelandrichardson / react-native.js
Last active Jul 22, 2020
React Native flow types
View react-native.js
declare var __DEV__: boolean;
declare module 'react-native' {
declare type Color = string | number;
declare type Transform =
{ perspective: number } |
{ scale: number } |
{ scaleX: number } |
jaredreich / timezones.json
Last active Jul 31, 2020
JSON Timezone List
View timezones.json
      "value": -12,
      "text": "(GMT -12:00) Eniwetok, Kwajalein"
      "value": -11,
      "text": "(GMT -11:00) Midway Island, Samoa"
maxcampolo / NativeWebView.swift
Created Jul 28, 2016
WKWebView setup to make a web page adopt native behavior.
View NativeWebView.swift
import WebKit
class NativeWebViewController: UIViewController {
let viewportScriptString = "var meta = document.createElement('meta'); meta.setAttribute('name', 'viewport'); meta.setAttribute('content', 'width=device-width'); meta.setAttribute('initial-scale', '1.0'); meta.setAttribute('maximum-scale', '1.0'); meta.setAttribute('minimum-scale', '1.0'); meta.setAttribute('user-scalable', 'no'); document.getElementsByTagName('head')[0].appendChild(meta);"
let disableSelectionScriptString = "'none';"
let disableCalloutScriptString = "'none';"
override func viewDidLoad() {
// 1 - Make user scripts for injection

How to add an image to a gist

  1. Create or find a gist that you own.
  2. Clone your gist (replace <hash> with your gist's hash):
    # with ssh
    git clone<hash>.git mygist
    # with https
    git clone<hash>.git mygist
cvan /
Last active Jul 22, 2020
Launch Chromium with API Keys on Mac OS X and Windows

Sometimes you need to use API Keys to use things like the Speech API. And then you Google a bit and follow all the instructions. But the Chromium Project's API Keys page does a not-so-great of explaining how to do this, so I will.

  1. Download Chromium.
  2. You'll notice a yellow disclaimer message appear as a doorhanger: Google API Keys are missing. Some functionality of Chromium will be disabled. Learn More.
  3. Clicking on that link takes you to the confusing API Keys docs page.
  4. If you aren't already, subscribe to the mailing list. (You can just subscribe to the list and choose to not receive any mail. FYI: the Chromium project restricts the APIs to those subscribed to that group - that is, Chromium devs.)
  5. Make sur
gaearon / index.js
Last active Jul 24, 2020
Breaking out of Redux paradigm to isolate apps
View index.js
import React, { Component } from 'react'
import Subapp from './subapp/Root'
class BigApp extends Component {
render() {
return (
<Subapp />
<Subapp />
<Subapp />
manigandham /
Last active Aug 8, 2020
Rich text / HTML editors and frameworks

Strictly Frameworks

Abstracted Editors

These use separate document structures instead of HTML, some are more modular libraries than full editors

  • ProseMirror - - supports collaborative editing, offers similar options to Mobiledoc for data structure
You can’t perform that action at this time.