Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

package main
import (
"fmt"
"strings"
)
type mapDiff struct {
a string
b string
/**
* @param { Function } reducer
* @param { Object } initialState
* @returns { Store } State
*/
function createPubSub() {
let messages = {};
/**
* Publish publishes messages
javascript:(function (d) {
var tables = d.getElementsByTagName('table'),
head = d.head || d.getElementsByTagName('head')[0],
styleElement = d.createElement('style'),
cssStr = '.table-flip {transition: 1s linear;transform: rotate(360deg);}';
styleElement.type = 'text/css';
styleElement.appendChild(d.createTextNode(cssStr));
head.appendChild(styleElement);
function toggleSpin() {
var i = 0,

Keybase proof

I hereby claim:

  • I am jgilless on github.
  • I am jgilless (https://keybase.io/jgilless) on keybase.
  • I have a public key whose fingerprint is 0921 FBAE EC70 C716 6697 13B1 786F 3370 267A 3902

To claim this, I am signing this object:

@jgilless
jgilless / create-next-redux-app.js
Created December 7, 2017 02:41
Nextjs + Redux + React app with opinionated architecture.
const fs = require('fs');
const { execSync } = require('child_process');
if (!process.argv[2]) {
console.log('useage: node create-next-app.js <appname>');
process.exit(1);
}
const rootFolder = process.argv[2];
@jgilless
jgilless / create-next-redux-app.sh
Last active December 7, 2017 00:05
Create Next App, instant regret writing it in bash not node.
#!/bin/bash
if [ -z "$1" ]
then
echo "No argument supplied"
exit 1
fi
mkdir $1 && cd $1

Use Case: Name of Use Case

Actors

  • List of all actors involved in the use case
  • Each actor should be distinct
  • Generalize to User and System before getting specific
  • Refer to each actor exactly as listed here through the rest of the document

Brief

Provide a brief overview (~paragraph) of what the use case includes. Roughly equivalent to a user story or an epic.

@jgilless
jgilless / application_helper.rb
Last active August 29, 2015 14:10
Application Helper for Blog Post
module ApplicationHelper
def markdown(text)
render_options = {
#do not allow any user-inputted HTML in the output.
filter_html: true,
#do not generate any <img> tags.
#no_images: true,
#do not generate any <a> tags.
#no_links: true,
#do not generate any <style> tags.
@jgilless
jgilless / euler3.rb
Created November 14, 2014 19:03
Ruby solution for Project Euler problem 3
# https://projecteuler.net/problem=3
puts "Find the largest prime factor of:"
STDOUT.flush #clears the buffer
max_num = Integer(gets.chomp)
def largest_prime_factor(num)
largest_factor = 1
#get rid of factors of 2
@jgilless
jgilless / euler2.rb
Last active August 29, 2015 14:09
Ruby solution for Project Euler problem 2
# https://projecteuler.net/problem=2
puts "Find the sum of even valued Fibonnaci terms which values do not exceed:"
STDOUT.flush #clears the buffer
num = Integer(gets.chomp)
def fibonacci(max_num)
fibonacci = [1,2] #first two numbers of the sequence
while fibonacci[-2] + fibonacci[-1] < max_num
fibonacci << fibonacci[-2] + fibonacci[-1] # next num in sequence