Skip to content

Instantly share code, notes, and snippets.

@frimik
frimik / puppet-template-patterns.erb
Last active May 6, 2020 12:02
Puppet Template Patterns to remember.
## Check if variable is defined
# Replaces has_variable?(var) and if @var variations.
# include?() pattern from @Jan_vStone.
#
# scope.lookupvar return values for undefined variables:
# Puppet 3.x: nil
# Puppet 2.6.x: :undefined
# Puppet 2.7.x: :undefined
<% if ! [:undefined, nil, ''].include?(masquerade_address = scope.lookupvar('ftp::masquerade_address')) -%>
MasqueradeAddress <%= masquerade_address %>
@marktheunissen
marktheunissen / pedantically_commented_playbook.yml
Last active April 26, 2024 23:26 — forked from phred/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
This playbook has been removed as it is now very outdated.
@ronjouch
ronjouch / ronj-autohotkey.ahk
Created April 20, 2012 13:28
Collection of AutoHotkey scripts I use
; Variables definition
; -----------------------------------------------------------------------------
EnvGet, userProfile, USERPROFILE
Software := userProfile . "\Dropbox\software\"
; Launch or toggle program, http://lifehacker.com/5468862/create-a-shortcut-key-for-restoring-a-specific-window
; -----------------------------------------------------------------------------
ToggleWinMinimize(WindowTitle)
{
SetTitleMatchMode,2
@sbp
sbp / gists.py
Created December 10, 2011 12:04
Download all of a user's gists
#!/usr/bin/env python
import sys, os, urllib, json
user = sys.argv[1]
u = urllib.urlopen('http://gist.github.com/api/v1/json/gists/' + user)
bytes = u.read()
u.close()
gistdir = user + '-gists'
@kares
kares / javascript.rake
Created May 2, 2010 13:20
rake task for compiling javascripts using google's closure compiler
# configure these defaults based on Your needs :
JS_FILES_DIR = 'public/javascripts' # the javascripts base directory
EXCLUDED_JS_FILES = %W{ cache/* test/* } # excluded from compilation
OUT_FILE_JS_EXT_PREFIX = ".min" # override with `rake ... OUT_EXT=_pack`
COMPILER_JAR_PATH = "lib/java/build/compiler.jar" # adjust the jar path !
# only required if running under JRuby - will compile multiple files
# faster as it does not need to run system `java -jar ...` commands.
#COMPILER_MAIN_CLASS = "com.google.javascript.jscomp.CommandLineRunner"