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 / 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 / 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({
@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 / 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 / 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">
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 / 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
{
"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 / 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>