Skip to content

Instantly share code, notes, and snippets.

View asabaylus's full-sized avatar

Asa Baylus asabaylus

View GitHub Profile
@asabaylus
asabaylus / convert-milliseconds.js
Created March 11, 2011 17:58
convert milliseconds to digital style time, ex: 12:59:59
/**
* Convert milliseconds in regular style time
* @author Asa Baylus
**/
function convertMilliseconds (ms, p) {
var pattern = p || "hh:mm:ss",
arrayPattern = pattern.split(":"),
clock = [ ],
@asabaylus
asabaylus / nginx
Created September 9, 2011 01:06
nginx init.d for v1.0.6
#!/bin/sh
#
# nginx - this script starts and stops the nginx daemin
#
# chkconfig: - 85 15
# description: Nginx is an HTTP(S) server, HTTP(S) reverse \
# proxy and IMAP/POP3 proxy server
# processname: nginx
# config: /usr/local/nginx/conf/nginx.conf
# pidfile: /usr/local/nginx/logs/nginx.pid
@asabaylus
asabaylus / getGuidByName
Created November 18, 2011 02:43
Get GUID from User Name
var users = {
"a54bca8764-13bx5-8nln8s-0ga7d" : {
"name" : "Louise Voress",
"type" : "Committee",
"primarynominator" : "Dorrie Hutchison",
"reviewer1" : {"name" : "Tom Jones", "grade" : "A", "comments" : "", "status" : "Saved"},
"reviewer2" : {"name" : "Lucy Young", "grade" : "A", "comments" : "", "status" : "Saved"},
"adjudicator" : {"name" : "Steven Taylor", "recommendation" : "Yes", "comments" : "", "status" : "Saved"},
"os" : [
{"name" : "Kevin Joseph", "vote" : "Yes", "comments" : "", "status" : "Saved"},
@asabaylus
asabaylus / git-vlog
Last active June 21, 2022 20:45
Git visual log for the console
# Git visual log displays commit tree view with who did what when and in which branch
git config --global alias.vlog 'log --graph --date-order --date=relative --pretty=format:"%C(cyan)%h: %Cblue - %an - %Cgreen %C(cyan)%ar:%Creset%n%s%n" --color'
@asabaylus
asabaylus / index.js
Created December 14, 2011 02:32
Node.js turn querystring params into JSON
var http = require('http'),
url = require('url'),
util = require('util');
http.createServer( function (req, res) {
res.writeHead( 200, {'Content-Type': 'text/plain'} );
var qs = url.parse( req.url, true );
res.write( util.inspect( qs.query ) );
@asabaylus
asabaylus / vlt add remove
Created June 19, 2012 01:24
Add / Remove for Adobe CQ5 VLT
# remove from CRX all files deleted from file system
$ vlt st | grep ! | cut -c 2- | xargs -I {} vlt rm {}
# add to CRX all files not yet in vlt control
$ vlt st | grep \? | cut -c 2- | xargs -I {} vlt add {}
# add all missing files into the CRX
vlt st | grep ^A | cut -c 2- | xargs -I {} vlt commit --force {}
# copy all modified files into the CRX
@asabaylus
asabaylus / grunt.js
Created July 6, 2012 12:26
Jasmine Junit Reporter Scafolding
/*global module:false*/
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: '<json:jquery.sessiontimeout.js.jquery.json>',
meta: {
banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
'<%= pkg.homepage ? "* " + pkg.homepage + "\n" : "" %>' +
@asabaylus
asabaylus / gist:3071099
Created July 8, 2012 14:12
Github Markdown Heading Anchors

Anchors in Markdown

To create an anchor to a heading in github flavored markdown. Add - characters between each word in the heading and wrap the value in parens (#some-markdown-heading) so your link should look like so:

[create an anchor](#anchors-in-markdown)

@asabaylus
asabaylus / gist:3310929
Created August 10, 2012 03:59
Load TypeKit using jQuery
(function() {
var config = {
kitId: "XXXXXXX",
scriptTimeout: 3000
}
, l = "wf-loading"
, d = "wf-inactive"
, h = $("html").addClass(l)
, t = setTimeout(function(){
h.removeClass(l).addClass(d);
@asabaylus
asabaylus / email-mamangement.html
Created September 5, 2012 20:44
Email App HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1"><title>
ACS Email Management
</title><meta id="storemsg" name="storemsg" /><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta name="application" content="Giving"/>
<!-- Search Engine Verify for Home Page -->
<meta name="msvalidate.01" content="3D92C0EE929BE04567ECFDE4F390DC96" />
<meta name="google-site-verification" content="xL7RtAlI13QtadjUtrjw9-TnDxGRYmO6ysBvEd9_xwQ" />