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 / LICENSE.txt
Created June 2, 2011 23:24 — forked from 140bytes/LICENSE.txt
140byt.es -- Click ↑↑ fork ↑↑ to play!
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@fabriziogiordano
fabriziogiordano / index.html
Created June 2, 2011 23:26
Javascript Math Floor vs. Bitwise operator
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>[Javascript] Math floor and bitwise operator</title>
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<style>
article, aside, figure, footer, header, hgroup,
io ho inserito nei meta della pagina questi valori:
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
<meta name="apple-mobile-web-app-capable" content="yes">
Poi in un <script> ho inserito lo scrollTo
Questo lo puoi chiamare da qualche funzione che chiami al load:
setTimeout(function(){window.scrollTo(0,1);}, 1000);
<body onload="setTimeout(function(){window.scrollTo(0,1);}, 1000);">
<div data-role="page">
<div data-role="header">
<h1>Page Title</h1>
</div><!-- /header -->
<div data-role="content">
@fabriziogiordano
fabriziogiordano / gist:1604211
Created January 13, 2012 01:52
Check iOS open from icon and send event to Google Analytics
if ('standalone' in navigator
&& navigator.standalone
&& (/iphone|ipod|ipad/gi).test(navigator.platform)
&& sessionStorage.standalone > 60*5*1000
// && !document.referrer //optional
){
sessionStorage.setItem('standalone', (new Date()).getTime());
_gaq.push(['_trackEvent', 'iOS', 'desktop', 'open']);
require 'net/http'
url = URI.parse('http://search.yahooapis.com/ContentAnalysisService/V1/termExtraction')
appid = 'YahooDemo'
context = 'Italian sculptors and painters of the renaissance favored
the Virgin Mary for inspiration'
query = 'madonna'
post_args = {
require 'mail'
require 'net/http'
Dir.glob('./new/*.eml').each do |entry|
#File.rename(entry, entry+".work")
mail = Mail.read(entry)
body = ''
if mail.parts.length
mail.parts.each do |p|
<div class="grid-4 work" id="25001">
<img src="http://c929092.r92.cf2.rackcdn.com/1.jpg" alt="">
<span class="sm">
<h4>Django meetup</h4>
<p>Proudly sponsoring Budapest&#39;s first Django Meetup group.</p>
<a href="#" class="btn small">show details</a>
</span>
</div>
@fabriziogiordano
fabriziogiordano / index.html
Created May 4, 2012 15:45
HTML5 - Tiny boilerplate
<!DOCTYPE html>
<html>
<head>
<title>HTML5 - Tiny boilerplate</title>
<link href="style.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="script.js"></script>
<script type="text/javascript"></script>
</head>
<body>
#Recursively delete .svn directories [ http://www.anyexample.com/linux_bsd/bash/recursively_delete__svn_directories.xml ]
rm -rf `find . -type d -name .svn`