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 foo ( arg ) { | |
| var bar = { | |
| 'test1': function () { | |
| return 1; | |
| }, | |
| 'test2': function () { | |
| return 2; | |
| }, | |
| 'test3': function () { | |
| return 3; |
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($, document, window, undefined) { | |
| 'use strict'; | |
| var Constructor = function( elm, options, id ) { | |
| this.el = elm; | |
| this.$el = $(elm); | |
| this.init( options ); | |
| }; | |
| Constructor.prototype = { |
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
| # NPM CheatSheet. | |
| # Super easy intall: npm comes with node now. | |
| # To create your own npm package: https://www.npmjs.org/doc/misc/npm-developers.html | |
| # More: https://www.npmjs.org/doc/ | |
| # 1. NPM Command Lines. | |
| # Local mode is the default. | |
| # Use --global or -g on any command to operate in global mode instead. |
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
| // Node.js CheatSheet. | |
| // Download the Node.js source code or a pre-built installer for your platform, and start developing today. | |
| // Download: http://nodejs.org/download/ | |
| // More: http://nodejs.org/api/all.html | |
| // 0. Synopsis. | |
| // http://nodejs.org/api/synopsis.html |
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 s = document.createElement('link'); | |
| s.rel='stylesheet'; | |
| s.type='text/css'; | |
| s.href="http://stevenf.com/pages/shutup/shutup-latest.css"; | |
| document.body.appendChild(s); | |
| void(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
| html { | |
| font-size: 62.5%; /* 1 */ | |
| } | |
| /* | |
| html { | |
| font-size: 62.5%; | |
| } | |
| body { |
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 playListURL = 'http://gdata.youtube.com/feeds/api/playlists/PLauc615WzcQMaiQYhTLDKPh1pII5p-vU2?v=2&alt=json&callback=?'; | |
| var videoURL= 'http://www.youtube.com/watch?v='; | |
| $.getJSON(playListURL, function(data) { | |
| console.log(data); | |
| var list_data=""; | |
| $.each(data.feed.entry, function(i, item) { | |
| var feedTitle = item.title.$t; | |
| var feedURL = item.link[1].href; | |
| var fragments = feedURL.split("/"); | |
| var videoID = fragments[fragments.length - 2]; |
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 script, | |
| scripts = document.getElementsByTagName('script')[0]; | |
| function load(url) { | |
| script = document.createElement('script'); | |
| script.async = true; | |
| script.src = url; | |
| scripts.parentNode.insertBefore(script, scripts); |
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 on(obj, type, fn) { | |
| if (obj.attachEvent) { | |
| obj['e'+type+fn] = fn; | |
| obj[type+fn] = function(){ obj['e'+type+fn]( window.event ); }; | |
| obj.attachEvent( 'on'+type, obj[type+fn] ); | |
| } else { | |
| obj.addEventListener( type, fn, false ); | |
| } | |
| } | |
| function off(obj, type, fn) { |