Skip to content

Instantly share code, notes, and snippets.

View garth's full-sized avatar

Garth Williams garth

View GitHub Profile
@garth
garth / Jakefile.js
Created January 16, 2012 18:37 — forked from wagenet/Assetfile.rb
Precompile .handlebars templates with Jake (nodejs)
var fs = require('fs')
var vm = require('vm')
var handlebarsjs = fs.readFileSync('path/to/handlebars.js', 'utf8')
var emberjs = fs.readFileSync('path/to/ember.js', 'utf8')
var templatesDir = 'path/to/template/dir'
desc('Compile all .handlebars templates')
task({ 'handlebars': [] }, function () {
process.stdout.write('Compiling .handlebars templates')
@garth
garth / run-mocha.js
Created July 10, 2012 09:19 — forked from joeytrapp/run-mocha.js
JavaScript: PhantomJS Mocha Scrapper
/*global phantom:true, console:true, WebPage:true, Date:true*/
(function () {
var url, timeout, page, defer;
if (phantom.args.length < 1) {
console.log("Usage: phantomjs run-mocha.js URL [timeout]");
phantom.exit();
}
url = phantom.args[0];
@garth
garth / Assetfile.rb
Created July 17, 2012 12:56 — forked from wagenet/Assetfile.rb
Ember Handlebars Precompile
require 'execjs'
class HandlebarsFilter < Filter
class << self
def contents
@@contents ||= [File.read("headless-ember.js"), File.read("ember.js")].join("\n")
end
def context
@@context ||= ExecJS.compile(contents)
@garth
garth / checkpoint.sh
Created December 22, 2016 15:45 — forked from phoob/checkpoint.sh
#!/bin/bash
#
# The reason of creating this script is that Endpoint Security VPN installs it's own application firewall kext cpfw.kext
# which prevents for example PPTP connections from this computer, which is not appropriate if you need subj connection just
# from time to time
# Usage: checkpoint.sh
# The script checks if Enpoint Security VPN is running. If it is, then it shuts it down, if it is not, it fires it up.
# Or, make an Automator action and paste the script.
# You will need sudo power, of course
#
/* CYCLONE_CONSTANTS */
var VlxDevConstants = VlxDevConstants || {};
/* g_cyclone_general_info */
VlxDevConstants.A_CYC_APPL_SW_VERSION = 1;
VlxDevConstants.A_CYC_APPL_SW_VERSION_1 = 2;
VlxDevConstants.A_CYC_APPL_SW_VERSION_2 = 3;
VlxDevConstants.A_CYC_APPL_SW_VERSION_3 = 4;
VlxDevConstants.A_CYC_APPL_SW_VERSION_4 = 5;
VlxDevConstants.A_CYC_APPL_SW_VERSION_5 = 6;