Skip to content

Instantly share code, notes, and snippets.

View koblas's full-sized avatar

David Koblas koblas

View GitHub Profile
@alexkrolick
alexkrolick / webpack.config.js
Last active July 13, 2017 04:11
Webpack Config for Webpack-Rails + CDN for production (Webpack 1.x - some minor differences may be encountered for Webpack 2+)
const CDN = process.env['CDN_HOST'] || '';
/**
* Webpack configuration for integrating Webpack with Rails via the webpack-rails gem
* (https://github.com/mipearson/webpack-rails)
*
* Cache-Busting Strategy:
* Development: Change query string of resource when content MD5 hash changes,
* rewriting the asset in place but triggering rewrite of the manifest.
* Production: Use MD5 hash of asset as filename, writing new assets and manifest
@jsianes
jsianes / ipassign
Last active May 27, 2024 07:51
Script to assign Public IP from Elastic IP pool for instances hosted in AWS. 'ec2-utils' and AWS CLI packages required. Instance role or access keys need to allow at least next EC2 actions: describe-addresses, associate-address and disassociate-address. Shell script is designed to be integrated with instance start-up
#!/bin/bash
# chkconfig: 2345 99 10
# description: Set Public IP from ElasticIP pool during instance startup
# processname: ipassign
# Provides: ipassign
# Required-Start:
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop:
# Short-Description: Set Public IP from ElasticIP pool during instance startup
@hvoecking
hvoecking / translate.go
Last active March 28, 2024 13:52
Golang reflection: traversing arbitrary structures
// Traverses an arbitrary struct and translates all stings it encounters
//
// I haven't seen an example for reflection traversing an arbitrary struct, so
// I want to share this with you. If you encounter any bugs or want to see
// another example please comment.
//
// The MIT License (MIT)
//
// Copyright (c) 2014 Heye Vöcking
//