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
My thoughts on writing tiny reusable modules that each do just one | |
thing. These notes were adapted from an email I recently sent. | |
*** | |
If some component is reusable enough to be a module then the | |
maintenance gains are really worth the overhead of making a new | |
project with separate tests and docs. Splitting out a reusable | |
component might take 5 or 10 minutes to set up all the package | |
overhead but it's much easier to test and document a piece that is |
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
{----------------------------------------------------------------- | |
A "Tree" represents a binary tree. A "Node" in a binary tree | |
always has two children. A tree can also be "Empty". Below I have | |
defined "Tree" and a number of useful functions. | |
This example also includes some challenge problems :) | |
-----------------------------------------------------------------} |
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
var concat = require('gulp-concat') | |
var concatCss = require('gulp-concat-css') | |
var csso = require('gulp-csso') | |
var del = require('del') | |
var elmBins = require('elm') | |
var glob = require('glob') | |
var gulp = require('gulp') | |
var jade = require('gulp-jade') | |
var jadeConcat = require('gulp-jade-template-concat') | |
var simpleSpawner = require('simple-spawner') |
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 | |
# Setup script for hacking chrome devtools | |
# Source -> https://medium.com/p/8c8896f5cef3 | |
echo "Creating folder and initialize a git repo" | |
mkdir devtools-frontend && cd devtools-frontend | |
git init | |
echo "Adding chromium remote and initialize sparse checkout" | |
git remote add upstream https://chromium.googlesource.com/chromium/blink |
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 | |
# Ask for the administrator password upfront. | |
sudo -v | |
# Keep-alive: update existing `sudo` time stamp until the script has finished. | |
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null & | |
# Update the package manager's listings | |
echo "Updating the package manager's listings" |
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
<body> | |
{{#constant}} | |
<div id="fb-root"></div> | |
{{/constant}} | |
<div> {{> fb_pic}} {{loginButtons}}</div> | |
<br /> | |
<div><h2>Click to post to your feed:</h2> {{> feed}} </div> | |
</body> |
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
// Run with jest | |
import knex from 'knex' | |
import knexPgUpsert from '../knexPgUpsert' | |
const db = knex({ client: 'pg' }) | |
const taps = [ | |
{ |
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
Meteor.startup(function() { | |
Template.fb_pic.pic = function() {// helper function to display the pic on the page | |
var userProfile; | |
userProfile = Meteor.user().profile; | |
if(userProfile) { // logic to handle logged out state | |
return userProfile.picture; | |
} | |
}; | |
}); |
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
const MetricTypeDefs = ` | |
# Primitive types for conveying geometric data | |
type Metric { | |
count: Int! | |
} | |
# The input for sendMetrics | |
input MetricInput { | |
name: String! | |
points: [Float!]! |
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 fs from 'fs'; | |
import path from 'path'; | |
import execa from 'execa'; | |
import { runner } from 'hygen'; | |
import Logger from 'hygen/dist/logger'; | |
export type ArgsObject = { [key: string]: string | boolean }; | |
export const readFileString = (path: string) => fs.readFileSync(path, 'utf8'); |
OlderNewer