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
// FROM http://jsperf.com/url-parsing | |
var urlParseRE = /^(((([^:\/#\?]+:)?(?:(\/\/)((?:(([^:@\/#\?]+)(?:\:([^:@\/#\?]+))?)@)?(([^:\/#\?\]\[]+|\[[^\/\]@#?]+\])(?:\:([0-9]+))?))?)?)?((\/?(?:[^\/\?#]+\/+)*)([^\?#]*)))?(\?[^#]+)?)(#.*)?/; | |
var url = "http://jblas:password@mycompany.com:8080/mail/inbox?msg=1234&type=unread#msg-content"; | |
urlParseRE.exec(url); | |
0: "http://jblas:password@mycompany.com:8080/mail/inbox?msg=1234&type=unread#msg-content" | |
1: "http://jblas:password@mycompany.com:8080/mail/inbox?msg=1234&type=unread" | |
2: "http://jblas:password@mycompany.com:8080/mail/inbox" | |
3: "http://jblas:password@mycompany.com:8080" |
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
// FROM http://jsperf.com/compare-array-unique-versions/4 | |
Array.prototype.getUnique = function () { | |
var arr = this; | |
var newArr = [], | |
i = 0, | |
j = 0, | |
obj = {}, | |
len = arr.length; | |
while (len--) { | |
if (!obj[arr[i]]) { |
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
// FROM http://jsperf.com/test-offset-jquery-vs-vanilla | |
function offset(elt) { | |
var rect = elt.getBoundingClientRect(), bodyElt = document.body; | |
return { | |
top: rect.top + bodyElt .scrollTop, | |
left: rect.left + bodyElt .scrollLeft | |
} | |
} | |
var offsetElt = offset(document.getElementById('element')); |
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
drush pm-disable mymodule | |
drush pm-uninstall mymodule | |
drush pm-enable mymodule |
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 console = console || { | |
log: function( ){ }, | |
info: function( ){ }, | |
warn: function( ){ }, | |
table: 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
**History** | |
http://en.wikipedia.org/wiki/File:Mosaic_Netscape_0.9_on_Windows_XP.png | |
http://dailyjs.com/2010/05/24/history-of-javascript-1/ | |
http://dailyjs.com/2010/05/31/history-of-javascript-2/ | |
http://dailyjs.com/2010/06/07/history-of-javascript-3/ | |
... | |
** How browsers work ** | |
http://taligarsiel.com/Projects/howbrowserswork1.htm |
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
<a href="mailto:mail@hostname.com">Email</a> | |
<a href="tel:01234567890">Phone Number</a> | |
<a href="callto:01234567890">Skyper Number</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
// FROM : http://playground.deaxon.com/js/vanilla-js/ | |
// and complement : http://putaindecode.fr/posts/js/de-jquery-a-vanillajs/ | |
Events | |
$(document).ready(function() { }); document.addEventListener("DOMContentLoaded", function() { }); | |
$("a").click(function() { }) [].forEach.call(document.querySelectorAll("a"), function(el) { | |
el.addEventListener("click", function() {}); | |
}); | |
Selectors |
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 app = angular.module('pushApp'); | |
app.run(function(PushFactory) { | |
document.addEventListener('deviceready', function () { | |
PushFactory.init(); | |
}); | |
}); | |
app.factory('PushFactory', ['CONFIG', '$http', function(CONFIG, $http) { | |
'use strict'; |
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
import Html exposing (Html, button, div, text) | |
import Html.Events exposing (onClick) | |
main = | |
Html.beginnerProgram { model = model, view = view, update = update } | |
-- MODEL |
OlderNewer