Skip to content

Instantly share code, notes, and snippets.

@esironal
esironal / loadScript.js
Created May 29, 2017 03:44 — forked from gustavopaes/loadScript.js
load a script, like a jsonp file, with callback and scope support
/**
* Carrega um script e executa callback
*/
(function(window, document, head) {
if(!window.loadScript) {
window.loadScript = function(url, callback, scope, charset) {
var sc = document.createElement('script');
sc.type = 'text/javascript';
sc.async = true;
sc.charset = charset || "utf-8";
@esironal
esironal / github-gist-api.js
Created May 28, 2017 23:11 — forked from techslides/github-gist-api.js
GitHub API to make Gists with Ajax
/*
Assuming jQuery Ajax instead of vanilla XHR
*/
//Get Github Authorization Token with proper scope, print to console
$.ajax({
url: 'https://api.github.com/authorizations',
type: 'POST',
beforeSend: function(xhr) {
xhr.setRequestHeader("Authorization", "Basic " + btoa("USERNAME:PASSWORD"));
@esironal
esironal / build.prop
Last active October 20, 2016 06:09 — forked from CHEF-KOCH/build.prop
Android Build.prop tweaks <- FOR ALL AOSP ROMS (4.0.x - 5.0.x) ->
# Begin build properties
# EOL UNIX
# 0.0 644 /system/build.prop
#
# Note: Some changes are Device and OS/ROM independent!
# Note2: Some settings are between
# performance and security <- I prefer last one
#
ro.build.id= -----
ro.build.display.id= -----
@esironal
esironal / node-and-npm-in-30-seconds.sh
Created August 19, 2016 23:56 — forked from isaacs/node-and-npm-in-30-seconds.sh
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
@esironal
esironal / git-cloneall
Created January 22, 2016 05:39 — forked from tstone2077/git-cloneall
Clones as usual but creates local tracking branches for all remote branches.
#!/bin/bash
# Clones as usual but creates local tracking branches for all remote branches.
# To use, copy this file into the same directory your git binaries are (git, git-flow, git-subtree, etc)
clone_output=$((git clone "$@" ) 2>&1)
retval=$?
echo $clone_output
if [[ $retval != 0 ]] ; then
exit 1
git archive --format zip --output /full/path/to/zipfile.zip master
@esironal
esironal / codemirror-cdn.html
Last active November 3, 2024 09:40
Codemirror CDN
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Code Mirror CDN</title>
<link rel="stylesheet" href="http://esironal.github.io/cmtouch/lib/codemirror.css">
@esironal
esironal / tabs.html
Created October 29, 2015 18:24
Creating tabs without jQuery
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<!-- This page is copyright Elated Communications Ltd. (www.elated.com) -->
<title>JavaScript tabs example</title>
<style type="text/css">
body { font-size: 80%; font-family: 'Lucida Grande', Verdana, Arial, Sans-Serif; }
@esironal
esironal / index.html
Last active March 9, 2022 06:01
rOdYKX
<html class="ie" lang="en">
<![endif]-->
<!--[if gt IE 9]><!-->
<html lang="en" class="cookie_used_true">
<!--<![endif]-->
<head>
<meta charset="UTF-8">