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
{ | |
// Settings | |
"passfail" : false, // Stop on first error. | |
"maxerr" : 100, // Maximum error before stopping. | |
// Predefined globals whom JSHint will ignore. | |
"browser" : true, // Standard browser globals e.g. `window`, `document`. | |
"node" : true, |
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
/** | |
* Generate a unique ID | |
* | |
* @param {Number} [len=15] - Optionally set a length of the generated string. | |
* Defaults to 15 characters, it's not recommended | |
* to go much lower than this in order to ensure | |
* uniqueness. | |
* | |
* @return {string} A unique ID. | |
*/ |
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 roundFloats(listOfFloats) { | |
var tempArr, | |
arraySum, | |
lowerSum, | |
largestFraction, | |
i; | |
// lowerSum will be the sum of all floats Math.floored | |
lowerSum = 0; | |
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
<!doctype html> | |
<html lang="en" ng-app> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Stop Events</title> | |
</head> | |
<body ng-controller="appCtrl"> | |
<div ng-click="doSomething()"> | |
<p>Hey!</p> | |
<div ng-click="doSomethingElse()" stop-event="click"> |
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
// Go to menue: | |
// find->find in files | |
// Switch on reg_ex button | |
// Find: | |
^.*\S+.*$ | |
// Where: | |
c:\your_folder\,*.php,*.phtml,*.js,*.inc,*.html, -*/folder_to_exclude/* | |
// Then click on the find button | |
// Be careful to not click on Replace!!! |
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
# node-webkit: | |
# https://github.com/rogerwang/node-webkit | |
# generator för grunt | |
# https://github.com/Dica-Developer/generator-node-webkit | |
# Installera Grunt, Bower, Yeoman | |
npm install -g yo grunt bower | |
# Installera node-webkit generatorn |
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
Here is a list of scopes to use in Sublime Text 2 snippets - | |
ActionScript: source.actionscript.2 | |
AppleScript: source.applescript | |
ASP: source.asp | |
Batch FIle: source.dosbatch | |
C#: source.cs | |
C++: source.c++ | |
Clojure: source.clojure | |
CoffeeScript: source.coffee |
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
Show hidden characters
{ | |
"user": { | |
"debug": false, | |
"delay": 0.25, | |
"error_color": "D02000", | |
"gutter_theme": "Packages/SublimeLinter/gutter-themes/Default/Default.gutter-theme", | |
"gutter_theme_excludes": [], | |
"lint_mode": "background", | |
"linters": { | |
"jshint": { |
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 f({a = "I'm A", b = "I'm B"} = {}) { | |
console.log(a); // >"I'm C" | |
console.log(b); // >"I'm B" | |
} | |
f({ a: "I'm C" }); |
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 = {} unless window? | |
global.$=require('jquery') unless jQuery? | |
global._=require('underscore') unless _? | |
global.Backbone=require('backbone') unless Backbone? | |
global.Mustache=require('../lib/mustache') unless Mustache? | |
global.localStorage=require('localStorage') unless localStorage? | |
global.Store=require('../lib/backbone.localStorage') unless Store? | |
global.jsdom = require("jsdom").jsdom | |
global.document = jsdom('<html><body></body></html>') | |
global.window = document.createWindow() |
OlderNewer