Skip to content

Instantly share code, notes, and snippets.

@banderson
banderson / remote-ui.md
Last active March 3, 2023 15:41
Remote UI discussion

Remote UI @ HubSpot

  • What we're building
  • Where remote-ui comes in
  • Our proposed architecture
  • Open questions







@banderson
banderson / gmail-github-filters.md
Created June 21, 2018 18:06 — forked from ldez/gmail-github-filters.md
Gmail and GitHub - Filters

Gmail and GitHub

Create new filters and create new labels.

Pull Request

from:(notifications@github.com) AND {"Patch Links" "approved this pull request." "requested changes on this pull request." "commented on this pull request." "pushed 1 commit." "pushed 2 commits." "pushed 3 commits."}

label: gh-pull-request

@banderson
banderson / github-project-cards.graphql
Created February 8, 2017 05:47
Fetch github project cards via graphql
{
repository(owner: "banderson", name: "life") {
projects(first: 30) {
totalCount
edges {
node {
name
number
url
columns(first: 30) {
@banderson
banderson / template.html
Last active August 29, 2015 14:10
Block Model Test Template
<!DOCTYPE HTML>
<html format=implicit>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
<link rel="stylesheet" type="text/css" href="https://static.ctctcdn.com/galileo/images/templates/Galileo-Template-Images/GalileoExternalCSS.css">
<style>
table {
@banderson
banderson / memoize.js
Created May 30, 2014 22:38
Memoizer: takes in any javascript function and adds memoization based on args
var memoize = function memoize(fn) {
var self = this;
return function newFn() {
newFn.__memo || (newFn.__memo = {});
var args = Array.prototype.slice.call(arguments),
hash = JSON.stringify(args);
return (hash in newFn.__memo)
? newFn.__memo[hash]
@banderson
banderson / pascal-original.coffee
Last active August 29, 2015 13:56
Pascal's Triangle in Coffeescript
module.exports = (rows) ->
result = []
for n in [0..rows]
if n is 0
result[n] = [1]
else
previous = new Array().concat 0, result[n-1], 0
current = []
for val, idx in previous
sum = val + previous[idx+1]
@banderson
banderson / flipper
Last active December 20, 2015 11:39
Ruby Script to flip text
!/usr/bin/env ruby
# encoding: UTF-8
# adapted from http://www.leancrew.com/all-this/2009/05/im-feelin-upside-down/
class Flipper
CHARS = " abcdefghijklmnopqrstuvwxyz,.?!'()[]{}".split('')
FLIPPED_CHARS = " ɐqɔpǝɟƃɥıɾʞlɯuodbɹsʇnʌʍxʎz'˙¿¡,)(][}{".split('')
DICTIONARY = Hash[CHARS.zip FLIPPED_CHARS]
@banderson
banderson / mathHelpers.java
Created February 6, 2012 16:03
Math Helpers: Greatest Common Divisor & Least Common Multiple
public class MathHelper {
// Find the Greatest Common Divisor using Euclid's Algorithm
// Adapted from: http://en.wikipedia.org/wiki/Greatest_common_divisor#Using_Euclid.27s_algorithm
public static int GreatestCommonDivisor(int a, int b) {
// base case: when b is zero, we've found the GCD
if (b == 0) {
return a;
}
// 1: how could you rewrite the following to make it shorter?
if (foo) {
bar.doSomething(el);
} else {
bar.doSomethingElse(el);
}
// answer
(foo)
? bar.doSomething(el)
/* inline-block */
#selector {
display: inline-block;
zoom: 1;
*display: inline;
}
/* min-width */
#selector {
min-width: 80px;