View aws-cli.sh
# Both are limited to HVM-based 64-bit AMIs backed by EBS
# Red Hat's latest GA images
alias ami_rhel="aws ec2 describe-images \
--filters \
'Name=root-device-type,Values=ebs' \
'Name=architecture,Values=x86_64' \
'Name=virtualization-type,Values=hvm' \
'Name=name,Values=*GA*' \
--owners 309956199498 \
View blog-webpack-2.md

This is the follow up to a post I wrote recently called From Require.js to Webpack - Party 1 (the why) which was published in my personal blog.

In that post I talked about 3 main reasons for moving from require.js to webpack:

  1. Common JS support
  2. NPM support
  3. a healthy loader/plugin ecosystem.

Here I'll instead talk about some of the technical challenges that we faced during the migration. Despite the clear benefits in developer experience (DX) the setup was fairly difficult and I'd like to cover some of the challanges we faced to make the transition a bit easier.

View etc-init-gitbucket.conf
#!upstart
description "gitbucket"
env USER=ubuntu
env PID=/var/run/gitbucket.pid
env STDOUT=/var/log/gitbucket/gitbucket.log
env STDERR=/var/log/gitbucket/gitbucket.err
start on (local-filesystems and net-device-up IFACE!=lo)
stop on [!12345]
View Makefile
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.
View auto-unrar.sh
#!/usr/bin/env bash
##
#
# @author Jay Taylor [@jtaylor]
#
# @date 2014-12-20
#
# @description Busy-box compatible automatic RAR extraction system.
#
View snake.go
package main
import (
"unicode"
)
// ToSnake convert the given string to snake case following the Golang format:
// acronyms are converted to lower-case and preceded by an underscore.
func ToSnake(in string) string {
runes := []rune(in)
View dataloop_post_install.sh
#!/usr/bin/env bash
set -e -x
# Shutdown the dataloop agent.
sudo service dataloop-agent stop || true
# Kill stragglers in the even that the service control didn't work right.
agentPids=$(ps -ef | grep 'dataloop-lin-agent' | grep -v 'grep' | sed 's/ \+/ /g' | cut -d' ' -f2)
test -n "${agentPids}" && sudo kill -9 ${agentPids}
View round.go
package main
import (
"log"
"math"
)
func Round(val float64, roundOn float64, places int ) (newVal float64) {
var round float64
pow := math.Pow(10, float64(places))
View test_split_jinja_ansible.yml
---
- name: Test split
hosts: localhost
gather_facts: false
vars:
- facter_blockdevices: "sda,sdb,sdc,sdd,sde,sdf"
tasks:
- name: Let's split
debug: var=item
with_items: "facter_blockdevices.split(',')"
View angularjs-providers-explained.md
Provider Singleton Instantiable Configurable
Constant Yes No No
Value Yes No No
Service Yes No No
Factory Yes Yes No
Decorator Yes No? No
Provider Yes Yes Yes

Constant