Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View ifthenelse's full-sized avatar
🏎️
LIFE BE LIKE

Andrea Collet ifthenelse

🏎️
LIFE BE LIKE
View GitHub Profile
@ifthenelse
ifthenelse / stili.css
Last active April 5, 2016 15:50
Stili di prova per adattamento mobile della newsletter
<style type="text/css">
.bentonsansbook {
font-family: "Benton Sans Book", Verdana, "Helvetica Neue", Helvetica, "Trebuchet MS", Arial;
font-style: normal;
font-weight: normal;
color: #0e0e0e;
}
.bentonsanslight {
font-family: "Benton Sans Light", Verdana, "Helvetica Neue", Helvetica, "Trebuchet MS", Arial;
@ifthenelse
ifthenelse / sf2_aliases.sh
Last active March 16, 2016 11:37
Aliases collection for Symfony 2
#!/bin/sh
# If superuser warn and prompt to continue
prompt_exec_as_root () {
if [[ `whoami` = 'root' -o $(id -u) == 0 -a -z "$SUDO_COMMAND" ]]; then
/bin/echo "Warning: you're running the script as superuser.";
/bin/echo "This may cause directory permission issues and you'll probably be unable to access your files anymore. \nIn malmost all the cases you're adviced to run as regular user."
/bin/echo "Do you still want to continue? [Yes/No/Abort] (default: No) "
read REPLY;
else if [[ ! $REPLY -o $REPLY =~ ^[Nn][Oo]?$ -o $REPLY =~ ^[Aa]([Bb][Oo][Rr][Tt])?$ ]]; then
@ifthenelse
ifthenelse / retroarch_20160131-180023.txt
Created January 31, 2016 17:03
Libretro Retroarch dumpfile on 2016/01/31 at 6:00:23 PM
RetroArch [INFO] :: === Build =======================================RetroArch [INFO] :: [CPUID]: Features:
RetroArch [INFO] :: Version: 1.3.0
RetroArch [INFO] :: Git: 97e0c86
RetroArch [INFO] :: =================================================
RetroArch [INFO] :: [CPUID]: Features:
RetroArch [INFO] :: Looking for config in: "/storage/.config/retroarch/retroarch.cfg".
RetroArch [INFO] :: Config: loading config from: /storage/.config/retroarch/retroarch.cfg.
RetroArch [INFO] :: Threaded rarch_task started
RetroArch [INFO] :: Loading dynamic libretro core from: "/tmp/cores/genesis_plus_gx_libretro.so"
RetroArch [INFO] :: Environ SET_VARIABLES.
@ifthenelse
ifthenelse / .htaccess
Last active February 7, 2016 15:05
Redirect to the page which most suits the client's language settings. Choice is made by Apache server contextually to "Accept-Language" HTTP header values. Current example fallbacks to English page if no suitable language is found.
# Declare the file which contains the index of its traslations
DirectoryIndex index.html.var
AddHandler type-map .var
# Redirect to specific language by explicit URL request
# /en -> index.html
# /it -> index_it.html
# /es -> index_es.html
<IfModule mod_rewrite.c>
@ifthenelse
ifthenelse / wp-template.sublime-project
Created December 21, 2015 10:23
Sublime Text 3 project file template for Wordpress
{
"folders":
[
{
"follow_symlinks": true,
"path": "/",
"folder_exclude_patterns": [
".sass-cache",
".bundles",
"node_modules",
@ifthenelse
ifthenelse / shell_snippets.sh
Created July 7, 2015 13:15
List of shell snippets
# Assuming the existence of a list of url, in a text file, get the file size of each url target (in Kb)
cat urls.txt | xargs -n 1 curl -sI | grep Content-Length | awk '{print $2/1000}'
{
"folders":
[
{
"follow_symlinks": true,
"path": ".",
"folder_exclude_patterns": [
".sass-cache",
".bundles",
"node_modules",
@ifthenelse
ifthenelse / _equal-display-inline-block-width.scss
Created May 14, 2015 15:04
Dynamically set inline-block elements equal width based on items length
@for $i from 1 through 10 {
/* #{$i} item(s) */
.box-ballooned-item:first-child:nth-last-child(#{$i}),
.box-ballooned-item:first-child:nth-last-child(#{$i}) ~ .box-ballooned-item {
max-width: floor(100% / $i);
}
}
@ifthenelse
ifthenelse / st3-sf2-template.sublime-project
Last active June 11, 2018 07:50
Sublime Text 3 project file template for Symfony2
{
"folders":
[
{
"follow_symlinks": true,
"path": "/",
"folder_exclude_patterns": [
".sass-cache",
"app/cache",
"bin",
@ifthenelse
ifthenelse / sticky.js
Last active August 29, 2015 14:10 — forked from chriskoelle/sticky.js
Add an affix behavior to an element, by keeping it sticky between 2 elements.
;(function($) {
$.fn.extend({
stickyWidget: function(options) {
// Exit if there are no elements to avoid errors:
if (this.length === 0) {
return this;
}
var settings = $.extend({