This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# A place for my git aliases | |
git config --global alias.lop 'log --pretty=oneline' | |
git config --global alias.pur 'pull --rebase' | |
git config --global alias.s 'status' | |
git config --global alias.c 'commit' | |
git config --global alias.cm 'commit -m' | |
git config --global alias.cam 'commit -a -m' | |
git config --global alias.fix 'commit --amend' | |
git config --global alias.fixup 'commit --fixup :/' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const obj = { | |
width: 0, | |
start() { | |
let extra = 0; | |
let interval = setInterval(() => { | |
if (width === 100) { | |
clearInterval(interval); | |
} | |
// the meat | |
if (Math.floor(Math.random() + 0.6)) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.*; | |
public class MyApp { | |
protected List<Integer[]> meetings = new ArrayList<>(); | |
public MyApp() { | |
meetings.add(new Integer[] { 3, 5}); | |
meetings.add(new Integer[] { 0, 1}); | |
meetings.add(new Integer[] { 4, 8}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Node { | |
protected String data; | |
protected Node next; | |
public Node(final String data, final Node next) { | |
this.data = data; | |
this.next = next; | |
} | |
public Node getNext() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var arr = [1, 7, 3, 4]; | |
var brute = function(arr) { | |
var i = 0; | |
var final_arr = []; | |
var temp_arr; | |
var j; | |
for (i; i < arr.length; i++) { | |
temp_arr = arr.slice(); | |
temp_arr.splice(i, 1); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var stock_prices = [15,14,11,10,8,6,5,2,1];//[10,11,12,15,8,9,10,14,11];//[10, 9, 8, 10, 13, 11, 9, 10, 15]; | |
var max_and_min = []; | |
var i = stock_prices.length - 1; | |
for (i; i >= 0; i--) { | |
if (max_and_min.length && (max_and_min[0].min == null || max_and_min[0].min > stock_prices[i])) { | |
max_and_min[0].min = stock_prices[i]; | |
} | |
if (!max_and_min.length || max_and_min[0].max < stock_prices[i]) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Boilerplate thread local singleton | |
*/ | |
protected Singleton() {} //enforce singleton pattern with protected constructor | |
private static ThreadLocal<Singleton> instance = null; //the current thread instance | |
/** Get the singleton instance of this service | |
* If no instance exists for this thread, instantiate one | |
* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function generateTable(arr) { | |
var content = {}, | |
headers = [], | |
longest = 0; | |
function setEmpies(content) { | |
for (var key in content) { | |
if (!content[key].affected) { | |
content[key].push(''); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
::-webkit-scrollbar{ | |
width: 10px; | |
} | |
::-webkit-scrollbar-track-piece{ | |
background-color: #FFF; | |
} | |
::-webkit-scrollbar-thumb{ | |
background-color: #CBCBCB; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_.compile = function(templ) { | |
var compiled = this.template(templ); | |
compiled.render = function(ctx) { | |
return this(ctx); | |
}; | |
return compiled; | |
} |
NewerOlder