Skip to content

Instantly share code, notes, and snippets.

View jesstelford's full-sized avatar

Jess Telford jesstelford

View GitHub Profile
@WebReflection
WebReflection / executable-standalone-module.md
Last active March 4, 2024 20:55
NodeJS Executable Standalone Module

Update

If you're OK in having a node-esm executable, please consider this solution.

#!/usr/bin/env sh
# the /usr/local/bin/node-esm executable
input_file=$1
shift
exec node --input-type=module - $@ <$input_file
@krishpop
krishpop / export-toby.js
Last active March 21, 2024 22:12
Export Toby
// code courtesy of Toby team
chrome.storage.local.get("state", o => (
((f, t) => {
let e = document.createElement("a");
e.setAttribute("href", `data:text/plain;charset=utf-8,${encodeURIComponent(t)}`);
e.setAttribute("download", f);
e.click();
})(`TobyBackup${Date.now()}.json`, o.state)
));
import React, { Component } from 'react';
import { graphql } from 'react-apollo';
import { MatchSummary, NoDataSummary } from '@mls-digital/react-components';
import MatchSummaryQuery from './match-summary.graphql';
const mapResultsToProps = ({ data }) => {
if (!data.match)
return {
loading: data.loading,
};
@kitten
kitten / reactiveconf-sc-cfp.md
Last active November 17, 2020 15:06
ReactiveConf 2017 Lightning Talk CFP: With styled-components into the future

styled-components Logo

With styled-components into the future

Preprocessing is dead, long live preprocessing!


This is a CFP for ReactiveConf 2017's open call for Lightning talks. If you'd like to see this talk become a reality, please ⭐ star this gist. #ReactiveConf

@michaelneu
michaelneu / customized-winston-logger.js
Created September 3, 2016 09:35
Customized Winston logger with chalk-colored output
var winston = require("winston"),
dateformat = require("dateformat"),
chalk = require("chalk");
module.exports = new (winston.Logger)({
transports: [
new (winston.transports.Console)({
timestamp: function () {
return dateformat(Date.now(), "yyyy-mm-dd HH:MM:ss.l");
},
@staltz
staltz / introrx.md
Last active May 3, 2024 13:00
The introduction to Reactive Programming you've been missing
@gnarf
gnarf / ..git-pr.md
Last active April 12, 2024 22:00
git pr - Global .gitconfig aliases for Pull Request Managment

Install

Either copy the aliases from the .gitconfig or run the commands in add-pr-alias.sh

Usage

Easily checkout local copies of pull requests from remotes:

  • git pr 4 - creates local branch pr/4 from the github upstream(if it exists) or origin remote and checks it out
  • git pr 4 someremote - creates local branch pr/4 from someremote remote and checks it out
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@bjhess
bjhess / pull_request_webhook.md
Created May 18, 2012 15:58
The way I had to add a github repo webhook for pull requests

This is more complex than necessary.

GitHub webhooks for a URL by default only fire on repo pushes. There appears to be no way in the web UI to set up webhooks for other events. And so we go to the API. I prefer to do this type of thing with Hurl.

{
  "name": "web",
 "active": true,