Skip to content

Instantly share code, notes, and snippets.

View jagandecapri's full-sized avatar

Jagatheesan Jag jagandecapri

  • Kuala Lumpur, Malaysia
View GitHub Profile
@jagregory
jagregory / gist:710671
Created November 22, 2010 21:01
How to move to a fork after cloning
So you've cloned somebody's repo from github, but now you want to fork it and contribute back. Never fear!
Technically, when you fork "origin" should be your fork and "upstream" should be the project you forked; however, if you're willing to break this convention then it's easy.
* Off the top of my head *
1. Fork their repo on Github
2. In your local, add a new remote to your fork; then fetch it, and push your changes up to it
git remote add my-fork [email protected]
@daneko
daneko / PHPUnit_vfsStream_memo.php
Created November 18, 2011 14:34
PHPUnit vfsStreamの使用方法メモ
<?php
require_once 'PHPUnit/Framework/TestCase.php';
require_once 'vfsStream/vfsStream.php';
// require_once 'hoge.php';
/**
* ファイルシステムのテストに関してはURL参照
* とりあえずざっくり使う方法メモ
* @see http://www.phpunit.de/manual/3.6/ja/test-doubles.html#test-doubles.mocking-the-filesystem.examples.ExampleTest.php
@bryhal
bryhal / gist:4129042
Created November 22, 2012 02:08
MYSQL: Generate Calendar Table
DROP TABLE IF EXISTS time_dimension;
CREATE TABLE time_dimension (
id INTEGER PRIMARY KEY, -- year*10000+month*100+day
db_date DATE NOT NULL,
year INTEGER NOT NULL,
month INTEGER NOT NULL, -- 1 to 12
day INTEGER NOT NULL, -- 1 to 31
quarter INTEGER NOT NULL, -- 1 to 4
week INTEGER NOT NULL, -- 1 to 52/53
day_name VARCHAR(9) NOT NULL, -- 'Monday', 'Tuesday'...
@hofmannsven
hofmannsven / README.md
Last active November 10, 2024 13:48
Git CLI Cheatsheet
@jessepollak
jessepollak / instaInterval.js
Last active February 11, 2018 12:52
setInterval + Immediately Invoked Function Expressions == instaInterval.
setInterval((function interval() {
// do something instantly then every 5 seconds
console.log('This is a better version of setInterval');
return interval;
})(), 5000);
@crosbymichael
crosbymichael / mesos-ubuntu-install.sh
Created July 9, 2014 18:43
Install mesos on ubuntu 14.04
#!/bin/bash
set -e
apt-get install -y curl python-setuptools python-pip python-dev python-protobuf
# zookeeper
apt-get install -y zookeeperd
echo 1 | dd of=/var/lib/zookeeper/myid
@sebsto
sebsto / gist:19b99f1fa1f32cae5d00
Created August 8, 2014 15:53
Install Maven with Yum on Amazon Linux
sudo wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo
sudo sed -i s/\$releasever/6/g /etc/yum.repos.d/epel-apache-maven.repo
sudo yum install -y apache-maven
mvn --version
@iros
iros / force.reqanimframe.js
Created April 15, 2016 19:49
force layout with d3.timer instead of tick loop
var force = d3.layout.force()
.charge(-150)
.linkDistance(30)
.size([width, height]);
d3.json("assets/500nodes.json", function(error, graph) {
if (error) throw error;
// Task 2:
// Connect the force layout to the nodes and links in our dataset
@0xjac
0xjac / private_fork.md
Last active November 18, 2024 00:09
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare [email protected]:usi-systems/easytrace.git

@martinsotir
martinsotir / conda_4.6_powershell.md
Last active October 7, 2024 15:34
Enable conda in powershell

Enabling conda in Windows Powershell

First, in an administrator command prompt, enable unrestricted Powershell script execution (see About Execution Policies):

set-executionpolicy unrestricted

Then makes sure that the conda Script directory in is your Path.