Skip to content

Instantly share code, notes, and snippets.

@simonewebdesign
simonewebdesign / fullscreen2.js
Created August 8, 2013 09:48
Full Screen in JavaScript (cross-browser) - another approach, with two different buttons
// quando clicco su enterfullscreen:
// vai in fullscreen
// mostra pulsante exitfullscreen
// nascondi header e footer
// quando clicco su exitfullscreen:
// esci da fullscreen
// mostra pulsante enterfullscreen
// mostra header e footer
@simonewebdesign
simonewebdesign / fullscreen3.js
Last active October 15, 2021 19:34
JavaScript Full Screen API (completely cross-browser!)
// quando clicco su enterfullscreen:
// vai in fullscreen
// all'entrata in fullscreen:
// mostra pulsante exitfullscreen
// nascondi header e footer
// quando clicco su exitfullscreen:
// esci da fullscreen
@simonewebdesign
simonewebdesign / centered.css
Created August 26, 2013 10:42
CSS class for centering a div box
.centered {
position: relative;
float: left;
}
.centered.outer {
text-align: justify;
right: 50%;
}
@simonewebdesign
simonewebdesign / scrollHorz.js
Created August 26, 2013 13:42
jQuery cycle horizontal scroll effect - demo: http://jquery.malsup.com/cycle/scrollhv.html
$('.foo').cycle({
fx: 'scrollHorz'
});
@simonewebdesign
simonewebdesign / scroll.html
Last active October 8, 2023 15:32
Scrolling feature for a web chat, without using libraries.It behaves like Skype: if the user is way too far from the bottom, it just doesn't scroll, because the user may be reading old posts.On the other hand, it will automatically scroll to the bottom on a "new message" event (in this demo, on button's click event).
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<style>
.content {
@simonewebdesign
simonewebdesign / applyDebug.js
Last active September 16, 2020 20:30
Debugging a JS app with Aspect Oriented Programming
function applyDebug(obj) {
for (var f in obj) {
if (obj.hasOwnProperty(f) && typeof obj[f] === 'function') {
console.log(obj[f].toString());
origFunc = obj[f];
obj[f] = function () {
console.debug("called at " + new Date());
return origFunc.apply(this, arguments);
@simonewebdesign
simonewebdesign / dark.sh
Created September 13, 2013 18:58
Sublime Text 3 dark sidebar!
cd ~/.config/sublime-text-3/Packages/Theme\ -\ Default/
wget https://gist.github.com/olivierlacan/1857652/raw/143290aa0a83cff3c6fe384986b8aae1540cd710/Default.sublime-theme
@simonewebdesign
simonewebdesign / install.sh
Created September 14, 2013 09:30
Sublime Text 3 Install syntax highlighting for Jade on Linux (Fedora 19)
cd ~/.config/sublime-text-3/Packages
git clone https://github.com/miksago/jade-tmbundle.git Jade
import static java.lang.System.out;
import java.util.ArrayList;
import java.util.List;
public class Euler4
{
static final int MIN = 100;
static final int MAX = 999;
max = 0
100.upto(999) { |a|
a.upto(999) { |b|
prod = a * b
max = [max, prod].max if prod.to_s == prod.to_s.reverse
}
}
puts "Maximum palindrome is #{ max }."