Skip to content

Instantly share code, notes, and snippets.

@ktonon
ktonon / dockify-config-file.sh
Last active July 13, 2016 00:21
Apply environment variables to a plain text file that has been prepared as a configuration template
#!/usr/bin/env bash
# Usage: dockify-config-file.sh PREFIX INFILE OUTFILE
#
# Will lockup environment variables that start with PREFIX_
# and replace all occurences of ${PREFIX_...} in INFILE,
# writing to OUTFILE.
#
# Useful for converting a non-docker friendly configuration file into
# a template which can be populated at runtime.
@ktonon
ktonon / namespace-example.js
Created September 13, 2011 13:27
Example of a namespace function to create a hierarchy of JavaScript objects.
//-------------------------------------------------------------
// your-company.js
window.yourCompany = {
version: '1.0',
namespace: function(path) {
var part,
currentObject = window,
parts = path.split('.')
;
@ktonon
ktonon / namespace.js
Created September 13, 2011 13:23
JavaScript window protection
(function() {
// Offending code.
})()
@ktonon
ktonon / .gitignore
Created August 27, 2011 18:40
Git Ignore file for Python projects
build
dist
*.egg-info
*.pyc
*~
.DS_Store
@ktonon
ktonon / .gitignore
Created August 25, 2011 19:34
Git Ignore file for XCode projects
.DS_Store
*.swp
*~.nib
build/
*.pbxuser
*.perspective
*.perspectivev3
*.mode1v3
*.mode2v3
xcuserdata