Skip to content

Instantly share code, notes, and snippets.

View chris-gunawardena's full-sized avatar

Chris Gunawardena chris-gunawardena

View GitHub Profile
@chris-gunawardena
chris-gunawardena / extract_mt_dns.js
Created April 21, 2015 06:18
JS script to extract DNS information from Media temple
//Run this script in the console when in https://ac.mediatemple.net/domains/index.mt
var domains = jQuery('tr.subDomain i+a');
var domains_dns_info = {};
for(var i=0; i<domains.length; i++)
{
(function(domain){
jQuery.get('https://ac.mediatemple.net/services/manage/zone/edit.mt?domain='+domain, function(return_str){
var start = return_str.indexOf("var records = new Array();");
var end = return_str.indexOf("var records_count = records.length;");
@chris-gunawardena
chris-gunawardena / gist:f814ed5afd16f228dc14
Created May 12, 2015 04:12
List of stackoverflow questions with over 500 points
curl -sS "http://stackoverflow.com/questions/tagged/javascript?sort=featured&pageSize=50" --compressed
| grep +500
| sed 's/^.*\/questions\/\([0-9]*\)\/.*$/http:\/\/stackoverflow.com\/questions\/\1/'
@chris-gunawardena
chris-gunawardena / prepare-commit-msg
Created May 22, 2015 01:18
Copy the attached ‘prepare-commit-msg’ file to \mobile\.git\hooks and it will automatically prepend the JIRA issue number to your commit message 
#!/bin/bash
if [ -z "$BRANCHES_TO_SKIP" ]; then
BRANCHES_TO_SKIP=(master develop test)
fi
BRANCH_NAME=$(git symbolic-ref --short HEAD)
#echo $BRANCH_NAME
$ curl -v -u YOUR_TOGGL_API_KEY_FROM_MY_PROFILE_PAGE:api_token -H "Content-Type: application/json" -d '{"time_entry":{"description":"New time entry","created_with":"API example code","start":"2015-05-27T09:00:00+10:00","duration":28800,"pid":9981129}}' -X POST https://www.toggl.com/api/v8/time_entries
#!/bin/bash
git stash
git checkout develop
git pull
#grunt build
#git commit -am "After grunt build"
OLD_TAG=$(git describe $(git rev-list --tags --max-count=1))
grunt version:patch
@chris-gunawardena
chris-gunawardena / add_version_label_to_jira_issues_in_git_tag.sh
Created June 23, 2015 01:18
Add version label to all issues since last tag
#Get last tag
OLD_TAG=$(git describe $(git rev-list --tags --max-count=1))
#Bump version and tag
grunt version:patch
#Get new tag
NEW_TAG=$(git describe $(git rev-list --tags --max-count=1))
#Get all commit messages between new and old tags
COMMIT_MSGS_BETWEEN_TAGS=$(git log $OLD_TAG..$NEW_TAG --oneline)
#Add version label to all tickets in this build
{
fragment: 'racing',
foundRoute: 'racing(/)',
expectedTrackingData: {
sb_events_type: 'Racing'
}
},
{
fragment: 'horse-racing/todays-racing',
foundRoute: ':racingType-racing/todays-racing(/)',
using UnityEngine;
using System.Collections;
public class WebCam : MonoBehaviour {
WebCamTexture webcamTexture;
Renderer renderer;
// Use this for initialization
void Start () {
webcamTexture = new WebCamTexture();
@chris-gunawardena
chris-gunawardena / Dockerfile
Last active February 3, 2016 23:31
Sportsbet Mobile web docker file
FROM node:0.12.9
MAINTAINER Chris Gunawardena <chris@gunawardena.id.au>
EXPOSE 4700
#INSTALL DEPS
RUN apt-get update
RUN apt-get install -y git ruby ruby-dev
RUN gem install compass
#FIREWALL WORKAROUND
@chris-gunawardena
chris-gunawardena / prepare-commit-msg
Created February 18, 2016 23:32
Goes inside /.git/hooks
#!/bin/bash
if [ -z "$BRANCHES_TO_SKIP" ]; then
BRANCHES_TO_SKIP=(master develop test)
fi
BRANCH_NAME=$(git symbolic-ref --short HEAD)
#echo $BRANCH_NAME