Skip to content

Instantly share code, notes, and snippets.

View fabriziogiordano's full-sized avatar
🎯
Focusing

Fabrizio Giordano fabriziogiordano

🎯
Focusing
View GitHub Profile
@fabriziogiordano
fabriziogiordano / linkedlistnyc.webscript.io.lua
Created November 2, 2012 06:15
linkedlistnyc.webscript.io
local response = http.request {
url = 'http://www.linkedlistnyc.org'
}
s = response.content
lk = string.match(s, "<title>(.*)</title>")
local twilio = require('webscriptio/lib/twilio.lua')
NameVirtualHost 127.0.0.1:80
<VirtualHost github.loc:80>
ServerAdmin github.loc
DocumentRoot "/Users/fabriziogiordano/Sites/github.loc/"
ServerName github.loc
ServerAlias www.github.loc
<Directory "/Users/fabriziogiordano/Sites/github.loc/">
Options Indexes FollowSymLinks Includes ExecCGI
@fabriziogiordano
fabriziogiordano / ga.js
Created November 30, 2012 05:22
Msisdn check
<script>
var _gaq=[
['_setAccount','UA-XXXXX-XX'],
['_setCustomVar', 1, '<TMPL_IF NAME=HEADER_MSISDN>MSISDN TRUE<TMPL_ELSE>MSISDN FALSE</TMPL_IF>', 'Leaf<TMPL_VAR NAME=_ID_LEAF>',2],
['_trackPageview']
];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];g.src='//www.google-analytics.com/ga.js';s.parentNode.insertBefore(g,s)}(document,'script'))
</script>
@fabriziogiordano
fabriziogiordano / json.ga.js
Created January 9, 2013 04:50
Json data Google Analitycs
var data = [
{ x:0, y:317 },
{ x:100, y:129 },
{ x:100, y:133 },
{ x:100, y:135 },
{ x:100, y:151 },
....
{ x:100, y:155 },
{ x:100, y:158 },
{ x:100, y:174 },
@fabriziogiordano
fabriziogiordano / heatmap.html
Created January 9, 2013 04:53
Simple Cancans on top of a mobile phone to draw the heat map.
<!DOCTYPE HTML>
<html>
<head>
<style>
body {margin: 0px;padding: 0px;}
img {
position: absolute;
left:0;
top:0;
}
<style type="text/css">
@font-face{
font-family: RedactedFont;
src: url('Redacted-Font/fonts/web/redacted-script.eot'); /* For IE */
src: local('redacted-script'), url('Redacted-Font/fonts/web/redacted-script.ttf') format('truetype'); /* For non-IE */
}
* {
font-family: RedactedFont;
@fabriziogiordano
fabriziogiordano / similarunlink.php
Last active December 15, 2015 07:29
Remove duplicate files based on similar_text filename
You are given two rectangles on a plane.
The centers of both rectangles are located in the origin of coordinates
(meaning the center of the rectangle's symmetry).
The first rectangle's sides are parallel to the coordinate axes:
the length of the side that is parallel to the Ox axis, equals w,
the length of the side that is parallel to the Oy axis, equals h.
The second rectangle can be obtained by rotating the first rectangle
relative to the origin of coordinates by angle α.
Example:
http://codassium.com/room/#37bc0c12e3514af2d6695ecba8c4513a
grep -e "^r[0-9]+\ \|\ fgiordano.*$[^[^-]*$]*" svn.log