This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Demo to find folders matching the pattern themes/{theme}/assetnodes/{site} | |
* Requires running `npm install async` | |
* Runs both using sync and async calls | |
* @TODO More error checking | |
*/ | |
var fs = require('fs'); | |
var async = require('async'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var http = require ('http'); | |
var webServer = http.createServer(function (req, res) { | |
res.writeHead(200, {'Content-Type': 'application/json'}); | |
res.end(JSON.stringify(req.headers)); | |
}).listen(8050); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--- Option A ---> | |
<cfloop index="trailItemIndex" from="0" to="#trailItemsCount - 1#"> | |
<cfset trailItem = trailItems.get(trailItemIndex) /> | |
<!--- Only list the first and last category, | |
with an ellipsis in the middle if more than two ---> | |
<cfif trailItemIndex GT 0> | |
<span class="breadcrumb-delimiter">></span> | |
</cfif> | |
<cfif (trailItemIndex EQ 0) OR (trailItemIndex EQ (trailItemsCount-1))> | |
<cfset trailItemLink = request.utility.makeLink(link = "/" & |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import logging | |
import json | |
import argparse | |
from kazoo.client import KazooState | |
from kazoo.client import KazooClient | |
logging.getLogger('kazoo.client').addHandler(logging.StreamHandler()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
## USAGE | |
# ./foreman_yaml.py < myserver.foreman.yaml > myserver.puppet.yaml | |
## Convert Foreman YAML: | |
# classes: | |
# build_environment_vars: | |
# env_vars: SERVER_ENVIRONMENT=development | |
# build_java: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Hack to change HipChat status to away when locking screen. This could be less | |
# hacky by connecting to hipchat using the "--message" option. However, this | |
# option only appears to support "about", "logout", "quit" and "wakeup" | |
# | |
# Tested in KDE (Kubuntu 16.10) | |
# | |
# Change HipChat status to away -> Lock screen -> Change HipChat status to | |
# available after screen is unlocked |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ -f '/usr/lib/slack/resources/app.asar.unpacked/src/static/ssb-interop.js' ]; then | |
target='/usr/lib/slack/resources/app.asar.unpacked/src/static/ssb-interop.js' | |
elif [ -f '/Applications/Slack.app/Contents/Resources/app.asar.unpacked/src/static/ssb-interop.js' ]; then | |
target='/Applications/Slack.app/Contents/Resources/app.asar.unpacked/src/static/ssb-interop.js' | |
fi | |
if [ "z${target}" = "z" ]; then | |
echo 'Unsupported platform or Slack is not installed' |