Skip to content

Instantly share code, notes, and snippets.

@simonewebdesign
simonewebdesign / .htaccess
Created March 8, 2014 21:12
My .htaccess (Apache configuration file)
# Apache configuration file
# httpd.apache.org/docs/2.2/mod/quickreference.html
# Note .htaccess files are an overhead, this logic should be in your Apache
# config if possible: httpd.apache.org/docs/2.2/howto/htaccess.html
# Techniques in here adapted from all over, including:
# Kroc Camen: camendesign.com/.htaccess
# perishablepress.com/press/2006/01/10/stupid-htaccess-tricks/
# Sample .htaccess file of CMS MODx: modxcms.com
@simonewebdesign
simonewebdesign / install_sublime_text.sh
Last active March 11, 2024 12:23
Install Sublime Text 3 on Linux via POSIX shell script - http://simonewebdesign.it/install-sublime-text-3-on-linux/
#!/bin/sh
# Sublime Text 3 Install (last update: Monday 13 March 2017)
#
# No need to download this script, just run it on your terminal:
#
# curl -L git.io/sublimetext | sh
# Detect the architecture
@simonewebdesign
simonewebdesign / animate-custom.css
Last active January 3, 2016 08:18
Cool animation for a "Shop Now" (or whatever) button
.animated{-webkit-animation-fill-mode:both;-moz-animation-fill-mode:both;-ms-animation-fill-mode:both;-o-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:1s;-moz-animation-duration:1s;-ms-animation-duration:1s;-o-animation-duration:1s;animation-duration:1s;}.animated.hinge{-webkit-animation-duration:1s;-moz-animation-duration:1s;-ms-animation-duration:1s;-o-animation-duration:1s;animation-duration:1s;}@-webkit-keyframes tada {
0% {-webkit-transform: scale(1);} 10%, 20% {-webkit-transform: scale(0.9) rotate(-3deg);}
30%, 50%, 70%, 90% {-webkit-transform: scale(1.1) rotate(3deg);}
40%, 60%, 80% {-webkit-transform: scale(1.1) rotate(-3deg);}
100% {-webkit-transform: scale(1) rotate(0);}
}
@-moz-keyframes tada {
0% {-moz-transform: scale(1);}
10%, 20% {-moz-transform: scale(0.9) rotate(-3deg);}
@simonewebdesign
simonewebdesign / exceptions.rb
Created January 6, 2014 15:42
Redefining Kernel module
class MyError < StandardError
end
module Kernel
def raise(*args)
# debugging...
puts "RAISE REDEFINED, and these are the *args:"
puts *args.inspect
@simonewebdesign
simonewebdesign / level5.js
Created October 7, 2013 17:25
"You Can't JavaScript Under Pressure" - LEVEL 5 - Closures + Recursion FTW! - http://toys.usvsth3m.com/javascript-under-pressure/
function arraySum(i) {
// i will be an array, containing integers, strings and/or arrays like itself.
// Sum all the integers you find, anywhere in the nest of arrays.
var sum = 0;
function maybeSum(x) {
if (typeof x === 'number') {
sum += parseInt(x);
} else if (Array.isArray(x)) {
@simonewebdesign
simonewebdesign / index.html
Last active August 16, 2022 21:51
Play WAV and MP3 files with HTML5 Audio
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>audio test</title>
</head>
<body>
<!-- <audio controls="controls" autoplay>
Your browser does not support the <code>audio</code> element.
<source src="smb_gameover.wav" type="audio/wav">
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 }."
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;
@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
@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