Skip to content

Instantly share code, notes, and snippets.

View ivolivares's full-sized avatar
🤙
Probably coding!

Iván Olivares R. ivolivares

🤙
Probably coding!
View GitHub Profile
@incompl
incompl / mq.js
Last active August 29, 2015 14:02
microquery
var $ = function(selector, context) {
if (context === undefined) {
context = document;
}
var nl = context.querySelectorAll(selector);
return Array.prototype.slice.call(nl);
};
@millermedeiros
millermedeiros / image.js
Created February 10, 2011 22:19
RequireJS Image Plugin
/*
* 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);
@aemkei
aemkei / LICENSE.txt
Created November 13, 2011 21:06 — forked from 140bytes/LICENSE.txt
Rubik's Pocket Cube Solver - 140byt.es
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
@Siedrix
Siedrix / key.json
Created August 10, 2012 00:28
Key bindings Sublime text
[
{ "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;"} }
]
@elijahmanor
elijahmanor / fiddle.html
Created January 31, 2012 05:31
jQuery Private Data Should Stay Private
<!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>
@goldhand
goldhand / bluetooth setup ubuntu 12.04
Created June 27, 2013 03:40
Setup Logitech K810 Keyboard to pair with ubuntu 12.04
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
@shazron
shazron / ios7.phonegap.cordova.js
Last active December 23, 2015 07:39
PhoneGap / Apache Cordova - top margin for iOS 7
// 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
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($)
}
};
};
}
@kaaes
kaaes / popup.html
Created August 15, 2012 21:42
Css animated popup - prototype
<!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');
@Jxck
Jxck / ecma5_on_v8.js
Created July 9, 2011 12:02
The sample usage of ECMA 5 Features Implemented in V8
/**
* 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