Skip to content

Instantly share code, notes, and snippets.

View jCrip's full-sized avatar
🏠
Working from home

Juan Cristobal Pazos jCrip

🏠
Working from home
  • Modyo
  • Santiago, Chile
View GitHub Profile
@jCrip
jCrip / jquery.spin.js
Created September 7, 2012 02:13 — forked from innotekservices/jquery.spin.js
jQuery Plugin for Spin.js
/*
You can now create a spinner using any of the variants below:
$("#el").spin(); // Produces default Spinner using the text color of #el.
$("#el").spin("small"); // Produces a 'small' Spinner using the text color of #el.
$("#el").spin("large", "white"); // Produces a 'large' Spinner in white (or any valid CSS color).
$("#el").spin({ ... }); // Produces a Spinner using your custom settings.
$("#el").spin(false); // Kills the spinner.
@jCrip
jCrip / index.html
Created July 17, 2012 16:59
A web page created at CodePen.io
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Loading Pixels &middot; CodePen</title>
<!--
Copyright (c) 2012 leison, http://codepen.io/leison
Permission is hereby granted, free of charge, to any person obtaining
@jCrip
jCrip / HTML SCRIPT: LiveReload
Last active October 3, 2015 08:57
HTML SCRIPT: LiveReload
<!-- LiveReload -->
<script>document.write('<script src="http://' + (location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1"></' + 'script>')</script>
@jCrip
jCrip / Prefixr+LiveReload.sh
Created March 20, 2012 15:55
Use Nettuts+ Prefixr with LiveReload
css="`cat assets/css/main.css`" && curl -sSd css="$css" http://prefixr.com/api/index.php > assets/css/main.css
@jCrip
jCrip / canvas-noise.js
Created March 19, 2012 18:47
Create noise with canvas
function generateNoise(opacity) {
if ( !!!document.createElement('canvas').getContext ) {
return false;
}
var canvas = document.createElement("canvas"),
ctx = canvas.getContext('2d'),
x, y,
number,
opacity = opacity || .2;
@jCrip
jCrip / Asset.html
Created March 15, 2012 14:25
Web App Meta Tags
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<link rel="apple-touch-startup-image" href="img/splash-screen.png" />
//iPad Landscape
<link rel="apple-touch-startup-image" sizes="1024x748" href="img/splash-screen-1024x748.png" />
//iPad Portrait
<link rel="apple-touch-startup-image" sizes="768x1004" href="img/splash-screen-768x1004.png" />
//iPhone Portrait
<link rel="apple-touch-startup-image" href="img/splash-screen-320x460.png" />
@jCrip
jCrip / Asset.css
Created March 15, 2012 14:23
Media Queries Bootstrap
// Landscape phones and down
@media (max-width: 480px) { ... }
// Landscape phone to portrait tablet
@media (max-width: 767px) { ... }
// Portrait tablet to landscape and desktop
@media (min-width: 768px) and (max-width: 979px) { ... }
// Large desktop
@jCrip
jCrip / Asset.js
Created March 15, 2012 14:22
Modern Event Handling
<script type="text/javascript">
/**
* Attach an event handler on a given Node taking care of Browsers Differences
* @param {Object} node
* @param {String} type
* @param {Function} fn
* @param {Boolean} capture
*/
function addEventHandler(node,type,fn , capture){
if(typeof window.event !== "undefined"){
@jCrip
jCrip / Asset.html
Created March 15, 2012 14:21
Redirect Mobile Devices
<script>
<!--
if ((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i))) {
location.replace("http://xxx");
}
-->
</script>
@jCrip
jCrip / Asset.html
Created March 15, 2012 14:20
Viewport Scaling Bug
<script>
(function(doc) {
var addEvent = 'addEventListener',
type = 'gesturestart',
qsa = 'querySelectorAll',
scales = [1, 1],
meta = qsa in doc ? doc[qsa]('meta[name=viewport]') : [];
function fix() {