Skip to content

Instantly share code, notes, and snippets.

Avatar

Asa Baylus asabaylus

View GitHub Profile
@asabaylus
asabaylus / gist:3071099
Created Jul 8, 2012
Github Markdown Heading Anchors
View gist:3071099

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)

View gitcheats.txt
# 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 Sep 1, 2020
AEM Deploy Script
View aem_deploy.sh
#!/bin/bash
#GLOBAL
HTTPRESPONSE="json"
SUCCESS="success"
#TEST
#UIARTFCT="target/package.zip"
#UILOC="./target/"
#AUTHORHOST="localhost"
@asabaylus
asabaylus / convert-milliseconds.js
Created Mar 11, 2011
convert milliseconds to digital style time, ex: 12:59:59
View convert-milliseconds.js
/**
* 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 / git-vlog
Last active Feb 1, 2020
Git visual log for the console
View git-vlog
# 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'
View foo.html
<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 Jun 19, 2012
Add / Remove for Adobe CQ5 VLT
View vlt add remove
# 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
Jira Keys from Git Branches
View get-keys
# 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 Dec 14, 2011
Node.js turn querystring params into JSON
View index.js
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 ) );