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
| /* | |
| +-----------------------------------------------------------------+ | |
| | Created by Chirag Mehta - http://chir.ag/projects/ntc | | |
| |-----------------------------------------------------------------| | |
| | ntc js (Name that Color JavaScript) | | |
| +-----------------------------------------------------------------+ | |
| All the functions, code, lists etc. have been written specifically | |
| for the Name that Color JavaScript by Chirag Mehta unless otherwise |
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
| #---------------------------------------------------------------------- | |
| # virtualbox error | |
| #---------------------------------------------------------------------- | |
| There was an error while executing `VBoxManage`, a CLI used by Vagrant | |
| for controlling VirtualBox. The command and stderr is shown below. | |
| Command: ["hostonlyif", "create"] | |
| Stderr: 0%... |
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
| JSON.stringify(jsObj, null, "\t"); // stringify with tabs inserted at each level | |
| JSON.stringify(jsObj, null, 4); // stringify with 4 spaces at each level |
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
| // @ref: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#Parameters | |
| function censor(key, value) { | |
| if (typeof value === "string") { | |
| return undefined; | |
| } | |
| return value; | |
| } | |
| var foo = { |
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
| Element.prototype.prependChild = function(newElement) { | |
| return this.insertBefore(newElement, this.firstChild); | |
| }; |
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
| <!DOCTYPE html> | |
| <html ng-app="myApp"> | |
| <head> | |
| <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.14/angular.min.js"></script> | |
| <meta charset="utf-8"> | |
| <title>JS Bin</title> | |
| </head> | |
| <body> | |
| <h1>Angular CORS configuration</h1> |
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() { | |
| var CSSCriticalPath = function(w, d, opts) { | |
| var opt = opts || {}; | |
| var css = {}; | |
| var pushCSS = function(r) { | |
| if(!!css[r.selectorText] === false) css[r.selectorText] = {}; | |
| var styles = r.style.cssText.split(/;(?![A-Za-z0-9])/); | |
| for(var i = 0; i < styles.length; i++) { | |
| if(!!styles[i] === false) continue; | |
| var pair = styles[i].split(": "); |
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 () { | |
| var scriptName = "embed.js"; //name of this script, used to get reference to own tag | |
| var jQuery; //noconflict reference to jquery | |
| var jqueryPath = "http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"; | |
| var jqueryVersion = "1.8.3"; | |
| var scriptTag; //reference to the html script tag | |
| /******** Get reference to self (scriptTag) *********/ | |
| var allScripts = document.getElementsByTagName('script'); |
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
| /*global angular: true, google: true, _ : true */ | |
| 'use strict'; | |
| angular.module('geocoder', ['ngStorage']).factory('Geocoder', function ($localStorage, $q, $timeout) { | |
| var locations = $localStorage.locations ? JSON.parse($localStorage.locations) : {}; | |
| var queue = []; | |
| // Amount of time (in milliseconds) to pause between each trip to the |
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
| require 'sinatra' | |
| require 'premailer' | |
| require 'json' | |
| configure :production do | |
| set :port, 80 | |
| end | |
| get '/premailer' do | |
| <<-eos |