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 / post-checkout
Last active August 29, 2015 14:04
A hook script to switch between parameters files when checking out different branches of the same Symfony2 repo
#!/bin/sh
#
# A hook script to switch between parameters files when checking out different branches of the same Symfony2 repo
#
# To enable this hook, rename this file to "post-checkout".
PREVIOUS_HEAD=$1
NEW_HEAD=$2
BRANCH_SWITCH=$3
@ifthenelse
ifthenelse / Show---Hide-full-size-divs-with-translate.markdown
Last active August 25, 2017 09:16
Hide and show full size DIV containers with CSS3 transitions on translate, rather than top, right, bottom, or left offset.

Show / Hide full size divs with translate

Hide and show full size DIV containers with CSS3 transitions on translate, rather than top, right, bottom, or left offset.

A Pen by Andrea Collet on CodePen.

License.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Page title</title>
<link rel="stylesheet" type="text/css" href="css/style.css" />
</head>
<body>
{
"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];
@ifthenelse
ifthenelse / fb-batch-dl.html
Last active December 25, 2015 17:09
Script that lists the images of a Facebook user, separated by album, using OpenGraph API. Just provide the target Facebook user id. Original code by Nicola de Lazzari. Thanks to Enrico Vedovo.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Facebook batch photo download</title>
<meta name="description" content="This script will hopefully last longer than other apps. At lest until FB will change their damnd API again">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css">
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-theme.min.css">
@ifthenelse
ifthenelse / regex-utils-st3
Created September 26, 2013 10:28
Useful regexp snippets for quick find/replace fixes on Sublime Text 2 and 3
// find all anchor tags without 'title' attribute
<a\s+((class|id|href|)="[^"]+"\s*)+/?>
// find all img tags without 'alt' attribute
<img\s+((width|height|border|class|id|src|usemap|hspace|vspace)="[^"]+"\s*)+/?>
@ifthenelse
ifthenelse / imgrollover.js
Created September 25, 2013 09:22
jQuery script to manage rollover effect on img elements with a '.hoverable' class and two images (one with -normal and one with -hover suffix)
// init rollovers on images
imgRollover: function() {
var $app = this;
$.each($app.$hoverable, function(index, val) {
var $this = $(this);
// if the hoverable object is <img>
if (typeof $this === 'object' && $this.is("img")) {
@ifthenelse
ifthenelse / fb_autogrowth.html
Last active December 22, 2015 03:29
Facebook autogrowth code for Facebook Tabs.
<div id="fb-root"></div>
<script type="text/javascript">
var goTo = true;
function goToLogIn() {
if (goTo) {
self.location = "{{ path('facebook_security_check') }}";
}
}
window.fbAsyncInit = function() {
FB.init({