Skip to content

Instantly share code, notes, and snippets.

View navio's full-sized avatar
🎯
Focusing

Alberto Navarro navio

🎯
Focusing
View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js"></script>
<meta charset=utf-8 />
<title>Domain Searcher</title>
</head>
<body>
<form name="domainsearch">
<input id="domainfield" type="search" placeholder="Find your Domain" name="domainsearch">
<!DOCTYPE html>
<html ng-app>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/sugar/1.3.9/sugar.min.js"></script>
<meta charset=utf-8 />
<title>Todo List - Using Angular</title>
</head>
@navio
navio / Install PhantomJS, CasperJS and dependencies.
Last active March 28, 2016 10:15
Script to install NVM, Node, PhantomJS and CasperJS without installing or using git.
#!/bin/bash
# Sets node version to install.
export NODE_VERSION=v0.10.21;
# Verify if nvm installation exist, otherwise install.
if ! hash "nvm" >/dev/null 2>&1; then
printf "Installing NVM %s\n" >&2
@navio
navio / domainr.html
Last active August 22, 2018 15:30
Angular Script to Query Domai.nr API
<!DOCTYPE html>
<html ng-app>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body ng-controller="domainSearcher">
<input ng-model="search" ng-change="getDomains()" type="search" placeholder="Search Domain" />
<input type="button" value="Go" ng-click="getDomains()" />
@navio
navio / updateDomain.sh
Last active August 29, 2015 14:02
CloudFlare IP update from Shell
#!/bin/bash
# set your user, token (key) name server and a comma-separated list of A records you want to change
[email protected]
CFP=myCloudFlareToken
CFNS=MYcloudFlareNS
CFHOSTS=my.host.tochange.com
CFUPHOSTS=myhost.tochange.com,myhost.tochange.com
# get your current external ip address
@navio
navio / lazyloads
Created July 1, 2014 22:14
Lazy Load Tests.
var images = Array.prototype.slice.call( document.querySelectorAll('img') );
// Disable Images - if not from BackEnd
images.forEach( function(image){
var source = image.getAttribute("src");
image.setAttribute("src", "");
image.setAttribute("data-src", source);
});
@navio
navio / Pocker_Again
Last active August 29, 2015 14:04
Deck Generator.
var PockerDeck = (function(suits,levels){
deck = [];
suits.forEach(function(suit){
levels.forEach(function(level){
deck.push(suit+level);
})
})
return deck;
})(['♠','♡','♢','♣'],['A','1','2','3','4','5','6','7','8','9','J','Q','K']);
@navio
navio / jsbin.qecelohe.css
Created August 11, 2014 04:54
Example of Gestures for Touch Devices
.pinch{background-color:yellow}
.tap{background-color:lightblue}
.hold{background-color:lightgreen}
.small-square
{
border: 1px solid black;
display:inline-block;
width:130px;
height:130px;
@navio
navio / Lazy Loading
Last active January 31, 2016 17:04
Lazy Loading.
function LL(){ //lazyload functionality;
var imageList = [];
function getImages(){
imageList.each(function(key,el){
var toSRC = el.attr("data-image");
el.attr("src",toSRC);
el.removeClass('lazyImage');
@navio
navio / Observer
Last active August 29, 2015 14:05
Observer JS
function ObserverList(){
this.observerList = [];
}
ObserverList.prototype.add = function( obj ){
return this.observerList.push( obj );
};
ObserverList.prototype.pull = function(obj){
return this.observerList.slice(0,1);