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 vs2013CommandPromptVariables() | |
{ | |
pushd 'C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools' | |
cmd /c "VsDevCmd.bat&set" | | |
foreach { | |
if ($_ -match "=") { | |
$v = $_.split("="); set-item -force -path "ENV:\$($v[0])" -value "$($v[1])" | |
} | |
} | |
popd |
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
REM Follow instructions at https://www.youtube.com/watch?v=2pvK-6321ig | |
REM If it does not work (keeps waiting at obtaining IP address) repeat the first step: | |
REM - go to "network connections", select the connection you want to share. Go to "properties" and "sharing". | |
REM - Deselect "Allow other users to connect through this computer's Internet connection". Click "OK". | |
REM - Go to "properties" and "sharing" again. | |
REM - select "Allow other users to connect through this computer's Internet connection". Select the network you just created just below that. Click "OK" | |
REM - Try again to connect. Should work. | |
netsh wlan set hostednetwork mode=allow ssid=TheW0lf key=<password_here> | |
netsh wlan start hostednetwork |
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
map ,t :w\|!ruby %<cr> |
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 () { | |
'use strict'; | |
var model = { | |
alarmActive: true | |
}; | |
var controller = { | |
init: function() { | |
if (this.alreadyRunning()) { |
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
[editor] | |
;Show line numbers. | |
; Type: boolean | |
line_numbers = true | |
;Visible tabs. | |
; Type: boolean | |
visible_tabs = 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
# taken from the "Design of Computer Programs" course by Peter Norvig | |
# https://www.udacity.com/course/cs212 | |
from functools import update_wrapper | |
def decorator(d): | |
"Make function d a decorator: d wraps a function fn." | |
def _d(fn): | |
return update_wrapper(d(fn), fn) | |
update_wrapper(_d, d) |
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
console.clear(); | |
function Car(name, loc) { | |
this.name = name; | |
this.loc = loc; | |
} | |
Car.prototype.move = function(){ | |
this.loc++; | |
console.log(this.name + "'s location is now " + this.loc.toString()); | |
}; |
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
/* stolen from http://stackoverflow.com/a/5515960/390819 */ | |
function lengthInUtf8Bytes(str) { | |
/* Matches only the 10.. bytes that are non-initial characters in a multi-byte sequence. */ | |
var m = encodeURIComponent(str).match(/%[89ABab]/g); | |
return str.length + (m ? m.length : 0); | |
} | |
var answers = document.querySelectorAll('div.answer'); | |
var codeBoxes = Array.prototype.map.call(answers, function(a){ |
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
# Creates a script that will: | |
# - customize the prompt to use posh-git-sh | |
# - add git-completion | |
DIRECTORY=~/.awesome-git-prompt | |
SCRIPT=~/git-prompt.sh | |
if [ ! -d "$DIRECTORY" ]; then | |
mkdir "$DIRECTORY" |
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 assertEquals(expected, actual){ | |
if(expected === actual){ | |
console.info('OK'); | |
} else { | |
console.error('(' + expected + ') !== (' + actual + ') !!!'); | |
} | |
} | |
function assertThrows(f){ | |
try{ |