Skip to content

Instantly share code, notes, and snippets.

View nybblr's full-sized avatar
🌱
I help developers craft their best work, achieve goals, and never stop growing.

Jonathan Lee Martin nybblr

🌱
I help developers craft their best work, achieve goals, and never stop growing.
View GitHub Profile
@nybblr
nybblr / ghost-to-static.sh
Last active December 21, 2017 12:48
Crawl a local Ghost blog instance and convert to a production-ready static site!
#!/bin/bash
DEV_HOST="localhost:2368"
PROD_HOST="blog.yellowscale.com"
BUILD_DEST=${1:-./build}
DEV_URL="http://${DEV_HOST}"
PROD_URL="https://${PROD_HOST}"
# Hop into build directory
pushd $BUILD_DEST > /dev/null
@nybblr
nybblr / metaproxy.js
Created October 28, 2017 18:43
Metaproxy: The proxy that doesn't do anything
/* Metaproxy
* The proxy that doesn't do anything
**/
let target = { a: 1, b: 2, c: 3 }
let handler = new Proxy({}, {
get: (...args) => Reflect[args[1]](...args)
})
@nybblr
nybblr / animals.rb
Created December 11, 2014 17:04
Module "inheritance" and ancestor tree.
module Fishish
def kind
"fish#{super}"
end
end
module Dogish
def kind
"dog#{super}"
end
@nybblr
nybblr / aliases.bash
Created February 12, 2015 22:00
Git aliases for writers
alias la='ls -la'
alias gl='git pull'
alias gp='git push'
alias gb='git branch'
alias gco='git checkout'
alias gs='git status -sb'
alias gc='git commit -m'
alias gaa='git add -A'
@nybblr
nybblr / .babelrc
Created March 7, 2017 18:00
ES2017 build pipeline in 5 seconds.
{
"presets": [
"es2015",
"es2016",
"es2017"
],
"plugins": []
}
@nybblr
nybblr / ember-data-stores.md
Created January 26, 2016 17:26
Ember Data: Multiple data stores

Multiple Ember Data stores

Need a separate data store? Maybe a temporary one for search results? Go for it!

// app/components/search-box.js
import Ember from 'ember';

export default Ember.Component.extend({
  store: Ember.inject.service('search-store'),
require 'yaml'
require 'csv'
class PlotLaser < Processing::App
def setup
@data = YAML.load File.open("albert.yml")
@smooth = false
no_smooth
@frame_index = 0
require 'date'
require 'yaml'
data = []
File.open "albert.rec" do |f|
f.each_slice(2) do |slice|
# key = items.delete_at(0).downcase
reads = slice.map do |line|
items = line.chomp.split(/\s+/)
@nybblr
nybblr / unicorn.sh
Created November 13, 2012 02:25 — forked from troex/unicorn.sh
Unicorn start/stop/restart script for Debian
#!/bin/sh
### BEGIN INIT INFO
# Provides: unicorn
# Required-Start: $local_fs $remote_fs mysql
# Required-Stop: $local_fs $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: unicorn initscript
# Description: Unicorn is an HTTP server for Rack application
### END INIT INFO
@nybblr
nybblr / drop-zone.emblem
Created June 25, 2015 22:06
Ember file uploads
div style="width:500px;height:500px;border:1px solid black;"
button click="browse"
| Browse
button click="upload"
| Upload
file-upload url="/files" onfile="onfile"
= yield