This file contains 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 Benchmark = function() { | |
}; | |
Benchmark.prototype.start = function() { | |
this.start = new Date().getTime(); | |
console.time('Benchmark'); | |
}; | |
Benchmark.prototype.stop = function() { |
This file contains 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
# use vi mode | |
setw -g mode-keys vi | |
# remap prefix to Control + a | |
set -g prefix C-a | |
unbind C-b | |
bind C-a send-prefix | |
# force a reload of the config file | |
unbind r |
This file contains 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() { | |
var errorCount = 0; | |
window.onerror = function(error, location, line) { | |
if (errorCount < 5) { | |
sendErrorReport(error + ' [' + location + ':' + line + ']'); | |
errorCount++; | |
} | |
return false; | |
}; | |
})(); |
This file contains 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 sendErrorReport = function(error) { | |
var xhr = createXMLHTTPObject(); | |
xhr.open('POST', endpointUrl, true); | |
xhr.send(error); | |
}; | |
var createXMLHTTPObject = function() { | |
var xmlhttp, XMLHttpFactories = [ | |
function() { | |
return new XMLHttpRequest(); |
This file contains 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 buyItem(itemId) { | |
if(!isValidItemId(itemId)) { | |
var errorReport = printStackTrace().join('\n'); | |
sendErrorReport(errorReport); | |
return; | |
} | |
try { | |
doBuyTheItem(itemId); |
This file contains 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
Window -> Preferences -> Java -> Appearance -> Type Filters | |
com.beust.jcommander.internal* | |
org.testng.collections.* | |
org.testng.internal.* |
This file contains 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
#!/bin/bash | |
# https://gist.github.com/josketres/ff195f4f1d64e7593f04#file-toggle-monitors-sh | |
# toggle your monitors setup between 'extended' and 'mirror' | |
# ideal for pair programming sessions | |
number_of_monitors=`xrandr | grep " connected" | cut -d " " -f 1 | wc -l` | |
if [ "$number_of_monitors" != "2" ] | |
then | |
echo "You should have 2 monitors connected to use this script" | |
exit 1 |
This file contains 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
<html> | |
<body> | |
<h1 id="title">Combinations</h1> | |
<input type="text" id="numbers" value="1,2,3,4,5" /> | |
<input type="text" id="stars" value="1,2,3" /> | |
<input type="submit" id="byBtn" value="Change" onclick="change()" /> | |
<div id="info"></div> | |
<div id="combinations"></div> | |
<script> |
This file contains 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
#!/bin/bash | |
# https://gist.github.com/josketres/45c53c2a3c50a7424bb9 | |
# Install mongoose binary in your ~/bin and add 'mongoosehere' alias | |
# ------------------------------------------------------------------ | |
# mongoosehere - Start an http server in your current directory | |
# assuming that ~/bin is added to your $PATH (in your .bashrc) | |
cd ~/bin | |
wget -O mongoose https://mongoose.googlecode.com/files/mongoose-lua-sqlite-ssl-static-x86_64-5.1 | |
chmod +x mongoose |
This file contains 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
cd %USERPROFILE%\vimfiles | |
wget --no-check-certificate https://raw.githubusercontent.com/sickill/vim-monokai/master/colors/monokai.vim |
OlderNewer