Skip to content

Instantly share code, notes, and snippets.

View ejamesc's full-sized avatar

Cedric Chin ejamesc

View GitHub Profile
{{!-- CHANGE this filter to filter for the category you'd like --}}
{{#get "posts" filter="tag:[books]" limit="4" as |books|}}
{{#if books}}
<div class='row'>
<div class='small-12 columns'>
{{!-- CHANGE this url to "/tag/<tagname>" to link to the tag addres --}}
<h2 class='home__books-section-heading'><a class="home__books-section-heading__a" href="{{@blog.url}}/tag/books">{{t "Book Summaries"}}</a></h2>
</div>
</div>
<div class='row home__books'>
@ejamesc
ejamesc / aside-demo.html
Created September 11, 2018 10:52
aside-demo.html
<aside class='pullquote-r'>This is a right pullquote</aside>
<aside class='pullquote-l'>This is a left pullquote</aside>
@ejamesc
ejamesc / copy-k8s-resources-across-namespaces.sh
Created February 24, 2018 11:07 — forked from simonswine/copy-k8s-resources-across-namespaces.sh
Copying kubernetes resources accross namespaces
kubectl get rs,secrets -o json --namespace old | jq '.items[].metadata.namespace = "new"' | kubectl create -f -
@ejamesc
ejamesc / bumpme
Last active October 12, 2017 15:33
Thu Oct 12 15:32:56 UTC 2017
tx7hb73y7xumb6j2qs02
iWMXTW+H5/ipNDxqS+En/DwV7xIaildiC1NN+kFjQYup8CoFD29XyopvJeG9UBxe
#!/usr/bin/env bash
# remove old tarsnap archives
# Copyright (c) 2015-2017 Jason W Ryan
# The MIT License (MIT) http://opensource.org/licenses/MIT
# number of archives to retain
keep=6
machine=$(hostname)
@ejamesc
ejamesc / round.py
Last active March 9, 2016 14:55
Solve rounding issues due to floating point repr in Python
from decimal import Decimal, ROUND_HALF_UP
a = round(2.675, 2)
b = Decimal(repr(2.675)).quantize(Decimal('.01'), rounding=ROUND_HALF_UP)
print a, b # 2.67, 2.68
{
init: function(elevators, floors) {
var waitingFloors = [];
var goOnIdle = function(elevator, floor) {
if (elevator.destinationDirection === "stopped") {
elevator.goToFloor(floor.floorNum());
return true;
}
return false;