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 $ = function(selector, context) { | |
if (context === undefined) { | |
context = document; | |
} | |
var nl = context.querySelectorAll(selector); | |
return Array.prototype.slice.call(nl); | |
}; |
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
/* | |
* Example #1 : usage example | |
* - Image paths are relative to the HTML file. | |
* - Support absolute paths as well. | |
* - Appending `!bust` to the end of the file name will avoid caching the image. | |
*/ | |
require(['image!lol_cat.gif', 'image!http://tinyurl.com/4ge98jz', 'image!dynamic_image.jpg!bust'], function(cat, awesome, dynamic){ | |
//add loaded images to the document! | |
document.body.appendChild(awesome); | |
document.body.appendChild(cat); |
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
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE> | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
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
[ | |
{ "keys": ["ctrl+u", "ctrl+i"], "command": "insert_snippet", "args": {"contents": "console.log('$SELECTION',$SELECTION);"} }, | |
{ "keys": ["ctrl+u", "ctrl+o"], "command": "insert", "args": {"characters": "console.log();"} }, | |
{ "keys": ["ctrl+u", "ctrl+p"], "command": "insert", "args": {"characters": "debugger;"} } | |
] |
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> | |
<head> | |
<script class="jsbin" src="http://code.jquery.com/jquery-1.7.1.min.js"></script> | |
<meta charset=utf-8 /> | |
<title>JS Bin</title> | |
<!--[if IE]> | |
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> | |
<![endif]--> | |
<style> |
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
1. Set keyboard discoverable | |
2. Get the mac address of the bluetooth device: | |
$ hcitool scan | |
3. Create new device: | |
$ sudo bluez-simple-agent hci0 [bluetooth device mac address = XX:XX:XX:XX:XX:XX] | |
which will hopefully return somthing like: | |
DisplayPasskey (/org/bluez/537/hci0/..., [PIN = 123456]) | |
else: | |
$ sudo bluez-simple-agent hci0 XX:XX:XX:XX:XX:XX repair | |
start over |
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
// Pre-requisites: | |
// 1. Device core plugin | |
// 2. Splashscreen core plugin (3.1.0) | |
// 3. config.xml: <preference name="AutoHideSplashScreen" value="false" /> | |
// 4. config.xml: <preference name="DisallowOverscroll" value="true" /> | |
function onDeviceReady() { | |
if (parseFloat(window.device.version) >= 7.0) { | |
document.body.style.marginTop = "20px"; | |
// OR do whatever layout you need here, to expand a navigation bar etc |
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
Application = {} | |
jQuery(function($) { | |
for( key in Application) { | |
if( Application.hasOwnProperty(key)) { | |
if (typeof Application[key]["init"] === "function" && $('body').hasClass('with-js-' + key.toLowerCase())){ | |
Application[key].init($) | |
} | |
}; | |
}; | |
} |
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> | |
<link href="style.css" rel="stylesheet" /> | |
<body> | |
<button id="open">click!</button> | |
<div id="popup" class="closed"><button id="close">click!</button></div> | |
</body> | |
<script src="popup.js"></script> | |
<script> | |
var p = document.getElementById('popup'); |
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
/** | |
* The sample usage of ECMA 5 Mozilla Features Implemented in V8 | |
* https://github.com/joyent/node/wiki/ECMA-5-Mozilla-Features-Implemented-in-V8 | |
* You can use thease new feature of ECMA5 on Node.js as you like. | |
* because there is no IE :) | |
* Order is deferent form original wiki. | |
* Sources are Checked on Node.js v0.5.0(unstable), v0.4.9(stable) | |
* | |
* you can execute this file. | |
* $ node ecma5_on_v8.js |
OlderNewer