Skip to content

Instantly share code, notes, and snippets.

View egm0121's full-sized avatar
⚛️
https://www.generationatomic.org/why-nuclear/

Giulio Dellorbo egm0121

⚛️
https://www.generationatomic.org/why-nuclear/
View GitHub Profile
@egm0121
egm0121 / jquery-clearform.css
Created November 10, 2011 15:49
Clear Form JS jQuery Plugin
.clearform{
display:inline-block;
margin-left:-16px;
cursor:pointer;
width:10px;
height:10px;
background-image:url('/close.gif');
-webkit-box-shadow: 0px 0px 10px 5px #fff ;
}
@egm0121
egm0121 / sitekey#page_id.suggest.js
Created August 20, 2012 21:45
upCloo suggest getData plugin
(function(g){ return "upcloo" in g && "suggest" in g.upcloo ? g.upcloo.suggest.getData = function(){ return ["SOME","JSON"];} :false;})(this);
@egm0121
egm0121 / async_snippet
Created September 1, 2012 09:18
async integration snippet
<script>
(function(g,opts) {
g.upCloo = g.upCloo || {};
g.upCloo.bootStrap = opts;
var s = document.createElement('script'); s.type = 'text/javascript'; s.async = true;
s.src = '../../js/upcloo.js';
var n = document.getElementsByTagName('script')[0];
n.parentNode.insertBefore(s,n);
})(this,{"pageId" : "123456","siteKey" : "MYSITEKEY"});
</script>
@egm0121
egm0121 / b.css
Created September 1, 2012 11:04
base css asset
.upcloo-over {
width:280px;
padding:5px 10px;
position:fixed;
top:auto;
left:auto;
bottom:auto;
right:auto;
z-index:99999;
display:block;
@egm0121
egm0121 / phantomDemo.js
Created November 13, 2012 15:16
Demo PhantomJs Scraping + WebServer
var endpoints = {
'demo': 'https://www.google.it/search?hl=it&output=search'
},
system = require('system'),
server = require('webserver').create(),
evaluate = function (page, func) {
var args = [].slice.call(arguments, 2);
var fn = "function() { return (" + func.toString() + ").apply(this, " + JSON.stringify(args) + ");}";
return page.evaluate(fn);
},
@egm0121
egm0121 / API.md
Created December 18, 2012 10:14 — forked from iros/API.md

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method:

-- Forward references
local soundID
-- Determine the platform type
-- "iPhoneOS" or "Android" or "Mac OS X"
--
local isAndroid = "Android" == system.getInfo("platformName")
local isSimulator = "simulator" == system.getInfo("environment")
function (c,p){var F = function(){}; F.prototype = p.prototype;c.prototype = new F();}
@egm0121
egm0121 / gist:4491791
Created January 9, 2013 09:16
google refine GREL snippet to generate Redis Protocol Code FOR SETting arbitrary key values pairs
"*3\r\n$3\r\nSET\r\n$"+length("mynamespace:"+cells["Column 1"].value)+"\r\n"+cells["Column 1"].value+"\r\n$"+length(cells["Column 2"].value)+"\r\n"+cells["Column 2"].value+"\r\n"
@egm0121
egm0121 / gist:4491804
Created January 9, 2013 09:19
Async script cross browser dom Ready detection
var _ready = function (doc) {
function dispatch() {
hasRun = 1;
for (var i = 0, l = queue.length; i < l; i++) queue[i]()
}
var hasRun = 0,
queue = [],
d, e, f = !1,
aElem = doc.createElement("a"),
dloaded = "DOMContentLoaded",