Skip to content

Instantly share code, notes, and snippets.

View asabaylus's full-sized avatar

Asa Baylus asabaylus

View GitHub Profile
@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 / 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 / gitcheats.txt
Last active March 31, 2022 17:27 — forked from chrismccoy/gitcheats.txt
git cheats
# From the last release to the HEAD of master
# find all commits with a Jira key
$ git log <branch_A>..<branch_B> 2> /dev/null | grep -Eo "[A-Za-z]+-[0-9]+" | sort | uniq
# checkout the same branch across multiple repos
$ ls | xargs -P10 -I{} git -C {} checkout <branch_name>
# make an alias to run a git command across multiple repo, add to ~/.bashrc or ~/.zshrc
alias agit="ls | xargs -P10 -I{} git -C {}"
@asabaylus
asabaylus / aem_deploy.sh
Last active September 1, 2020 07:41
AEM Deploy Script
#!/bin/bash
#GLOBAL
HTTPRESPONSE="json"
SUCCESS="success"
#TEST
#UIARTFCT="target/package.zip"
#UILOC="./target/"
#AUTHORHOST="localhost"
@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 / foo.html
Created April 28, 2017 12:19
birst
<html>
<head>
<script src="https://code.jquery.com/jquery-2.1.4.js" type="text/javascript"></script>
<script src="https://sde.birst.com/js/birst_embed.js" type="text/javascript"></script>
<script type="text/javascript">
var ssoUrl = 'https://sde.birst.com/TokenGenerator.aspx?birst.username=birstforward2016@birst.com&birst.ssopassword=wVn4lZIoEx81nj7BsdC1OJ3TsGdkJF2N&birst.spaceId=6760e6ce-413c-4f41-9b90-6d9906158299';
var params = '&birst.module=newDashboards&birst.embedded=true&birst.dashboard=Sales%20Analysis&birst.page=Summary';
function ssoPost( params ) {
$.post( ssoUrl, {}, function( data ) {
var opts = { width: '100%', height: '800', iframeSrc: 'https://sde.birst.com/SSO.aspx?birst.SSOToken=' + data + params };
@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 / get-keys
Last active May 18, 2017 20:22
Jira Keys from Git Branches
# From the last release to the HEAD of master
# find all commits with a Jira key
$ git log origin/6.6..master | grep -Eo [A-Za-z]+-[0-9]+ | sort | uniq
@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 ) );