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 / Dynamic grid layout in SASS
Created June 27, 2017 16:23
Programmatically stack SASS breakpoints in a json-like structure and use them to create a grid system layout
$smallphone: 480px;
$phone: 640px;
$tablet: 768px;
$desktop: 1024px;
$wide: 1440px;
// Grid breakpoints map
$breakpoints: (small: null, medium: "screen and (min-width: 768px)", large: "screen and (min-width: 1440px)");
// Non-grid breakpoints map
alias nom='npm cache clean && rm -rf node_modules && mkdir node_modules && tmutil addexclusion $(pwd)/node_modules && touch node_modules/.metadata_never_index && npm install'
alias bom='bower cache clean && rm -rf bower_components && mkdir bower_components && tmutil addexclusion $(pwd)/bower_components && touch bower_components/.metadata_never_index && bower install'
@ifthenelse
ifthenelse / riepilogo.html
Created June 9, 2016 17:59
Header riepilgoo checkout
<section class="shop-checkout--cart section-without-vertical-margin layout-grid is-active">
<div class="row">
<div class="col small-12 medium-8 medium-shift-2 large-6 large-shift-3">
<header class="shop-checkout--cart--header">
<h2>Riepilogo ordini</h2>
</header>
<article id="cart-item-riso" class="shop-checkout--cart-item">
<div class="shop-checkout--cart-item--info riepilogo">
<p class="shop-checkout--cart-item--name bentonsanslight__big uppercase">
<span class="bentonsansbold">5 x</span> <a href="/shop-categoria.html" title="Riso" target="_self" class="shop-checkout--cart-item--link">Riso</a>
@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 / .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 / 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.
{
"folders": [{
"follow_symlinks": true,
"path": "www/htdocs",
// folder_exclude_patterns and file_exclude_patterns control which files
// are listed in folders on the side bar. These can also be set on a per-
// project basis.
"folder_exclude_patterns": [".svn", ".git", ".hg", "CVS", ".sass-cache", "vendor/", "app/storage/cache/", "app/storage/logs/", "docs/"],
"file_exclude_patterns": ["*.sublime-*", "*.pyc", "*.pyo", "*.exe", "*.dll", "*.obj", "*.o", "*.a", "*.lib", "*.so", "*.dylib", "*.ncb", "*.sdf", "*.suo", "*.pdb", "*.idb", ".DS_Store", "*.class", "*.psd", "*.db", "*.scssc"],
// These files will still show up in the side bar, but won't be included in
@ifthenelse
ifthenelse / gist:7925614
Created December 12, 2013 09:53
Impostazioni di esportazione dei dump mySQL di phpMyadmin
Tabella
@SERVER@-@DATABASE@-@TABLE@-%Y%m%d-%H%M%S
Database
@SERVER@-@DATABASE@-%Y%m%d-%H%M%S
Server
@SERVER@-%Y%m%d-%H%M%S
var vimeoRegexp = /(?:https?\:)?\/\/(?:www\.|player\.)?vimeo.com\/(?:video\/|channels\/|groups\/([^\/]*)\/videos\/|album\/(\d+)\/video\/|)(\d+)(?:$|\/|\?)/;
var vimeoVideoUrl = "//player.vimeo.com/video/2243632";
var vimeoVideoArray = vimeoRegexp.regexp(vimeoVideoUrl);
var vimeoVideoID = vimeoVideoArray[3];