Skip to content

Instantly share code, notes, and snippets.

View CGastrell's full-sized avatar

Christian Gastrell CGastrell

View GitHub Profile
@CGastrell
CGastrell / cargarXML.html
Created August 8, 2013 16:19
Ejemplo para cargar un XML y parsear los marcadores para meter en un mapa argenmap()
<!doctype html>
<html lang="es">
<head>
<meta charset="utf-8" />
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script src="http://code.jquery.com/jquery-1.8.2.js"></script>
<script type="text/javascript" src="http://www.ign.gob.ar/argenmap/argenmap.jquery.min.js"></script>
<script>
$(function() {
@CGastrell
CGastrell / index.js
Created June 25, 2014 22:00
Mini server para recibir un archivo zip
//para probar, correr con node y en otra consola consolear:
//curl --request PUT 'http://localhost:8000/put' --upload-file archivo.zip
var http = require('http');
var fs = require('fs');
http.createServer(function(request,response){
response.writeHead(200);
var destinationFile = fs.createWriteStream("destination.zip");
request.pipe(destinationFile); // aca esta la magia, use wisely
@CGastrell
CGastrell / droppable.js
Created October 15, 2014 02:19
tha droppable
jQuery.widget("shovelapps.buildable", {
options: {
platformBaseUrl: ""
},
_create: function() {
var _this = this,
box = this.element;
this.styleBox();
box.on('dragenter', doNothing);
@CGastrell
CGastrell / README.md
Last active August 29, 2015 14:08 — forked from shedd/README.md

Usage

Install cordova into node_modules

npm install cordova

Add icons_and_splash.js

@CGastrell
CGastrell / snow
Created December 20, 2014 18:19
found at popcorntime.io
var popcorn={initialize:function(){this.polyfill(),analytics.initialize({"Google Analytics":{trackingId:"UA-38440155-3",domain:"popcorntime.io",universalClient:!0}}),analytics.pageview()},polyfill:function(){for(var a=["ms","moz","webkit","o"],b=0;b<a.length&&!window.requestAnimationFrame;b++)window.requestAnimationFrame=window[a[b]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[a[b]+"CancelAnimationFrame"]||window[a[b]+"CancelRequestAnimationFrame"]},detectUA:function(a){return/Mac/.test(a)?"mac":/Win/.test(a)?"win":/Lin/.test(a)?/x86_64/.test(a)?"lin-64":"lin-32":void 0},updateDownloads:function(a){document.body.className+=" "+(this.detectUA(a)||"nope")},updateStatus:function(a,b){$.get(b,function(b){$(a).addClass(b.status.indicator)},"json")},smoothScroll:function(){$("a[data-scroll][href*=#]:not([href=#])").click(function(){if(location.pathname.replace(/^\//,"")==this.pathname.replace(/^\//,"")&&location.hostname==this.hostname){var a=$(this.hash);if(a=a.length?a:$("[name="+this.hash.slice(1)
@CGastrell
CGastrell / sample.css
Last active August 29, 2015 14:15
Building media queries
body {
font-size: 14px;
}
/*
...
bunch of lines with excellent css
...
*/
/* targeting iPhones from 1 through 5 */
@CGastrell
CGastrell / sample2.css
Last active August 29, 2015 14:15
Example of or in media queries
body {
font-size: 14px;
}
/* targeting iPhones 1 through 5 and any other device which height is less than 480px */
@media screen and (max-device-width: 320px, max-device-height: 480px) {
body: {
font-size: 16px;
}
}
@CGastrell
CGastrell / camera.html
Last active August 29, 2015 14:21 — forked from dhavaln/camera.html
<!DOCTYPE html>
<html>
<head>
<title>Capture Photo</title>
<meta name="viewport" content="width=device-width,height=device-height,initial-scale=1"/>
<script type="text/javascript" charset="utf-8" src="js/phonegap.js"></script>
<script type="text/javascript" charset="utf-8">
var pictureSource; // picture source
var destinationType; // sets the format of returned value
@CGastrell
CGastrell / test.html
Created July 21, 2015 20:48
Sample mail structure
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled Document</title>
</head>
<body bgcolor="#0093D0">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tbody>
@CGastrell
CGastrell / DrawBuffer.js
Last active October 6, 2015 17:02
Buffer control
/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
* full list of contributors). Published under the 2-clause BSD license.
* See license.txt in the OpenLayers distribution or repository for the
* full text of the license. */
/**
* @requires OpenLayers/Control.js
* @requires OpenLayers/StyleMap.js
* @requires OpenLayers/Feature/Vector.js