Skip to content

Instantly share code, notes, and snippets.

View beck's full-sized avatar

Doug beck

View GitHub Profile
cd /dev/shm
git clone --single-branch ~/git/yola/sitebuilderui
git remote rm origin
git update-ref -d refs/tags/pre-template-component-purge
git filter-branch --index-filter '
git ls-files -s \
| sed "s|\t.*/nabtext\.js$|\tnabtext/nabtext.js|" \
@beck
beck / debugging.js
Created November 16, 2016 17:31
Lodash and Amersand Router clash
global.location = {};
global.location.replace = function(){};
global.location.href = '';
global.location.pathname = '';
global.window = {};
global.window.location = global.location;
var partialRight = require('lodash').partialRight;
var partial = require('lodash').partial;
var AmpRouter = require('ampersand-router');
@beck
beck / Star Wars.md
Last active November 23, 2016 19:49
Neumann's Star Wars Recommendations

New Disney-Era Star Wars Canon Novels (all currently released novels):

Dark Disciple by Christie Golden - 20 years before A NEW HOPE - Based on unproduced episodes of Star Wars: The Clone Wars, this new novel features Asajj Ventress, former Sith apprentice turned bounty hunter and one of the great antiheroes in the Star Wars galaxy. My notes: This will probably one be exciting if read by someone who was a fan of the CLONE WARS TV show.

Catalyst by James Luceno - ROGUE ONE prequel - Lauded Star Wars author James Luceno returns to pen an intense tale of ambition and betrayal that sets the stage for Rogue One: A Star Wars Story. My Notes: this is said to be a prequel to the new movie ROGUE ONE. Luceno is one of the best Star Wars novelists and has written quality novels in that universe for years.

Ahsoka by E. K. Johnston - 18 years before A NEW HOPE - Fans have long wondered what happened to Ahsoka after she left the Jedi Order near the end of the Clone Wars, and before she re-appeared as the mysterious Re

@beck
beck / git-fixup
Last active December 2, 2016 03:26
git fixup
#!/bin/bash
#
# git fixup - squash current changes into the last commit
#
# Stores the current head in branch 'doug/fixup'.
#
git branch -f doug/fixup
git add -A
@beck
beck / fixed-bg-ios.html
Created February 17, 2017 23:36
Simulating background-attachment fixed for iOS
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style>
html {
background: url(http://i.imgur.com/vu9P5mN.jpg);
background-size: cover;
background-position: center;
@beck
beck / git-fixup
Created March 30, 2017 17:34
A git bin to auto fixup
#!/bin/sh
#
# git fixup - squash current changes into the last commit
#
# Stores the current the current head in 'doug/fixup'.
#
git branch -f doug/backup
git add -A
@beck
beck / png-crush.sh
Created September 5, 2017 19:46
Crush the pngs
#!/bin/sh
# Cause stefano said: You can get them even smaller with
# http://www.advancemame.it/comp-readme.html after crushing
# it operates on the deflate compression, not the PNG image data
git ls-files | grep \.png$ | while read img
do
echo -n "$img..."
size_old=$(stat -f%z "$img")
@beck
beck / recursive-char-generator.js
Created November 21, 2017 01:14
Can you nest generators?
// This is an excessively over-engneered solution for when you forget
// `node.textContent` strips all child html :)
// to run:
// node --version # v9.2.0
// npm install jsdom
// node recursive-char-generator.js
const jsdom = require("jsdom");
const { JSDOM } = jsdom;
@beck
beck / managing-python.md
Last active July 24, 2018 06:04
Managing Python

Managing Python

Getting Started

is everything borked?

What is the output of which python?

If /usr/bin/python then using the system python that comes with OSX. 😬

@beck
beck / urlstr.js
Last active March 29, 2018 16:16
urlstr
/*
Why is this needed?
> is `url.format` broken or am I?
> https://github.com/nodejs/help/issues/1176
Would like to:
- extract this as a standalone lib
- support all spaces as options:
https://nodejs.org/api/url.html#url_url_strings_and_url_objects