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
// Class creation | |
function Vehicle(p) { | |
this.brand = p.brand || ""; | |
this.model = p.model || ""; | |
this.wheels = p.wheels || 0; | |
} | |
// Main class' methods | |
Vehicle.prototype.getBrand = function () { | |
return this.brand; |
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
<? | |
class entry{ | |
private $id = -1; // required | |
private $title = ""; // required | |
private $author = -1; // required, author ID | |
private $excerpt = ""; // either turn title into excerpt or manually enter one | |
private $date = ""; // required | |
// #TODO | |
// post type interface? |
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 href="http://stackoverflow.com/questions/7794301/window-onunload-is-not-working-properly-in-chrome-browser-can-any-one-help-me/9325742#9325742">Leave this page!</a> |
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 a = '5'; | |
var b = new String('5'); | |
console.log( typeof a, typeof b, a == b, a === b ); | |
/* Output: | |
> string | |
> object | |
> true |
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
// from: http://stackoverflow.com/a/3969760/649239 | |
function Timer(callback, delay) { | |
var timerId, start, remaining = delay; | |
this.pause = function() { | |
window.clearTimeout(timerId); | |
remaining -= new Date() - start; | |
}; |
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 () { | |
'use strict'; | |
// change "moduleName" to the name of the module you are making | |
var moduleName = {}; | |
// do something | |
if (typeof module !== 'undefined' && module.exports) { | |
module.exports = moduleName; | |
} else { |
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
# Clear screen | |
cls | |
# Get user | |
$USER = $PWD.toString() | |
$USER = $USER.Remove(0, 9) | |
# Get hostname | |
$HOSTNAME = HOSTNAME.exe |
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
F12:: | |
DetectHiddenWindows, on | |
If WinExist("posh~git") OR WinExist("Windows PowerShell") | |
{ | |
If WinActive("posh~git") OR WinActive("Windows PowerShell") | |
{ | |
WinHide | |
if(temptitle="") | |
WinActivate ahk_class Shell_TrayWnd |
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
// returns true if your browser supports calc() | |
myapp.checkCalc = function (prefix = '') { | |
var el = document.createElement('div'); | |
el.style.cssText = prefix + 'width: calc(1px);'; | |
return !!el.style.length; | |
}; | |
// returns true if your browser supports any version of calc(), prefixed or not | |
myapp.checkAllCalc = function (prefix = '') { | |
return myapp.checkCalc('-webkit-') || myapp.checkCalc('-moz-') || myapp.checkCalc(); |
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
plugins=(gitfast last-working-dir ssh-agent bower nvm gem node npm rbenv themes grunt autoenv zsh-syntax-highlighting command-not-found) |