Skip to content

Instantly share code, notes, and snippets.

@wutupake
wutupake / fb_fanpage.html
Created April 20, 2011 08:24
Se le dimensioni della fan page superano 520px X 800px, usare questo metodo (OLDES)
<html>
<body style="overflow: hidden;margin:0px;padding:0px">
<div id="fb-root"></div>
<script src="http://connect.facebook.net/en_US/all.js"></script>
<script>
window.fbAsyncInit = function() {
FB.Canvas.setAutoResize();
@wutupake
wutupake / input.js
Created November 23, 2011 17:01
JS: input form - seleziono il contenuto al load della pagina (fix per CHROME)
$("input[name='answer']").focus(function(){
this.select();
});
// fix per CHROME
$("input[name='answer']").mouseup(function(e){
e.preventDefault();
});
@wutupake
wutupake / index.html
Created October 2, 2012 13:52
JS: Scroll to the top of the page
<a name="top"></a> ... <a href="#top">Back to top</a>
<div class="myvideo">
<iframe src="http://www.youtube.com/embed/MY-VIDEO" frameborder="0" allowfullscreen></iframe>
</div>
@wutupake
wutupake / url_only.php
Created November 7, 2012 18:22
WP: Next/Previous Post URL only
<?php if (get_adjacent_post(false, '', false)): // if there are newer posts ?>
<a href="<?php echo get_permalink(get_adjacent_post(false,'',false)); ?>" class="article-nav prev">&nbsp;</a>
<?php endif; ?>
<?php if (get_adjacent_post(false, '', true)): // if there are older posts ?>
<a href="<?php echo get_permalink(get_adjacent_post(false,'',true)); ?>" class="article-nav next">&nbsp;</a>
<?php endif; ?>
@wutupake
wutupake / Fetch.sublime-settings
Created January 23, 2013 14:40
SUBLIME TEXT: list of "fetch stuff" that i like
{
"files":
{
"backbone": "http://backbonejs.org/backbone-min.js",
"jquery": "http://code.jquery.com/jquery.min.js",
"raphaeljs": "http://github.com/DmitryBaranovskiy/raphael/raw/master/raphael-min.js",
"underscore": "http://underscorejs.org/underscore-min.js"
},
"packages":
{
/*
#ie10 will only be red in MSIE 10,
both in high contrast (display setting) and default mode
*/
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
#ie10 { color: red; }
}
@wutupake
wutupake / box-model.css
Created February 15, 2013 07:46
CSS: box-model where [width] = [element-width] + [padding] + [borders]
*,
*:after,
*:before {
box-sizing: border-box;
}
@wutupake
wutupake / gitondropbox.txt
Last active March 27, 2017 15:17
TERMINAL: Git repository on Dropbox (you can use Sugarsync, Box.net, ...)
// Init Git on your Dropbox folder (es: "index.git" is the name of the repo)
git init --bare index.git
// Add origin repository on your project folder
git remote add origin file:///Path/to/your/Dropbox/folder/index.git/
@wutupake
wutupake / module-pattern.js
Last active February 17, 2016 11:45
JS: module pattern
(function(){
var module = (function() {
var _privateMethod = function() {
};
var _protectedMethod = function() {
// io posso usare privateMethod
};