Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View chengsoonong's full-sized avatar

Cheng Soon Ong chengsoonong

View GitHub Profile
@chengsoonong
chengsoonong / scan_repo_url.py
Created May 31, 2016 00:30
Get repo URLs. Look one level deeper for git, hg or svn repositories, and get their original URLs
"""Look one level deeper for git, hg or svn repositories, and get their original URLs"""
import os
import subprocess
import argparse
def scan_repo():
"""Extract the URL of the repository"""
get_git_url = 'git config --get remote.origin.url'
get_hg_url = 'hg paths default'
@chengsoonong
chengsoonong / .travis.yml
Created July 13, 2015 15:24
travis, coveralls, pydata
# pydata with anaconda: an example
language: python
python:
- "3.4"
notifications:
email: false
before_install:
- wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
@chengsoonong
chengsoonong / git-destroy.sh
Created May 8, 2015 02:00
Delete a file, and destroy its history in git.
#!/bin/bash
# This script removes a file from the git repository and destroys all its history.
#
# Based on https://help.github.com/articles/remove-sensitive-data/
#
# To do a dry run, add a -n to the git rm command. I.e.
# "git rm -n --cached --ignore-unmatch $1"
printf "Really destroy $1 ? y/[n] "
@chengsoonong
chengsoonong / data-provenance
Created March 20, 2015 05:41
Data Provenance working paper
## Motivation
Data provenance is metadata which keeps track of where a piece of data comes from,
and what operations have been done to it. This metadata provides a way to assess authenticity,
enable trust and allows reproducibility. This is particularly important when the data users,
data producers, and data wranglers are different groups of people.
## Overall idea
We have two types of objects, data and programs, of which we need to keep track of. Each dataset
@chengsoonong
chengsoonong / gsoc2014-machine-learning.ipynb
Last active November 20, 2017 16:17
GSoC 2014 projects related to machine learning
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@chengsoonong
chengsoonong / copulademo.ipynb
Created April 9, 2014 05:55
Introduction to copulas
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@chengsoonong
chengsoonong / README.md
Last active August 29, 2015 13:58
Demo for Rede: A network visualisation tool for probe pairs arising in genome wide association studies
@chengsoonong
chengsoonong / datamaps.world.min.js
Last active December 28, 2015 15:29
Number of authors by country of origin, visualised using d3.js and datamaps.js. This data was for ACML 2013. Green countries do not have any authors, and all other colours are on a linear scale from blue (low) to red (high).
!function(){function a(a){return this.svg=d3.select(a).append("svg").attr("width",a.offsetWidth).attr("height",a.offsetHeight),this.svg}function b(a,b){var c,d;return b&&"undefined"==typeof b.scope&&(b.scope="world"),"usa"===b.scope?c=d3.geo.albersUsa().scale(a.offsetWidth).translate([a.offsetWidth/2,a.offsetHeight/2]):"world"===b.scope&&(c=d3.geo[b.projection]().scale((a.offsetWidth+1)/2/Math.PI).translate([a.offsetWidth/2,a.offsetHeight/("mercator"===b.projection?1.45:1.8)])),d=d3.geo.path().projection(c),{path:d,projection:c}}function c(){d3.select(".datamaps-style-block").empty()&&d3.select("head").attr("class","datamaps-style-block").append("style").html('path {stroke: #FFFFFF; stroke-width: 1px;} .datamaps-legend dt, .datamaps-legend dd { float: left; margin: 0 3px 0 0;} .datamaps-legend dd {width: 20px; margin-right: 6px; border-radius: 3px;} .datamaps-legend {padding-bottom: 20px; z-index: 1001; position: absolute; left: 4px; font-size: 12px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif