Skip to content

Instantly share code, notes, and snippets.

View lohic's full-sized avatar

Loïc Horellou lohic

View GitHub Profile
@arthurattwell
arthurattwell / dialog.html
Last active August 1, 2022 09:54
Google Sheets script to allow multi-select in cells with data-validation (adapted from https://www.youtube.com/watch?v=dm4z9l26O0I)
<div style="font-family: sans-serif;">
<? var data = valid(); ?>
<form id="form" name="form">
<? if(Object.prototype.toString.call(data) === '[object Array]') { ?>
<? for (var i = 0; i < data.length; i++) { ?>
<? for (var j = 0; j < data[i].length; j++) { ?>
<input type="checkbox" id="ch<?= '' + i + j ?>" name="ch<?= '' + i + j ?>" value="<?= data[i][j] ?>"><?= data[i][j] ?><br>
<? } ?>
<? } ?>
<? } else { ?>
@lohic
lohic / JS-check-internal-link.js
Last active August 29, 2015 13:58
history.js check internal link
@lohic
lohic / !!! wordpress_gallery-3.php
Last active January 4, 2016 19:19
3 script gallerie wordpress
@lohic
lohic / wordpress_gallery.php
Last active March 14, 2016 07:32
Wordpress Gallery PHP
@rachelbaker
rachelbaker / matchMedia.js
Created August 24, 2012 17:38
jQuery matchMedia event handler for mobile
jQuery(document).ready(function($) {
// load touchdown resposnive nav
$('#site-navigation .menu').Touchdown();
// check window size
if (matchMedia) {
var mq = window.matchMedia("(min-width: 769px)");
mq.addListener(WidthChange);
WidthChange(mq);
}
@Adirael
Adirael / fix-wordpress-permissions.sh
Created August 17, 2012 23:16
Fix wordpress file permissions
#!/bin/bash
#
# This script configures WordPress file permissions based on recommendations
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions
#
# Author: Michael Conigliaro <mike [at] conigliaro [dot] org>
#
WP_OWNER=www-data # <-- wordpress owner
WP_GROUP=www-data # <-- wordpress group
WP_ROOT=$1 # <-- wordpress root directory
@tqc
tqc / MainViewController.h
Created April 19, 2012 14:36
PhoneGap / Cordova Splash Screen Fix
#ifdef CORDOVA_FRAMEWORK
#import <Cordova/CDVViewController.h>
#else
#import "CDVViewController.h"
#endif
@interface MainViewController : CDVViewController
@property (nonatomic, readwrite, retain) UIImageView *splashView;
@tjlytle
tjlytle / imageColor.php
Created November 17, 2009 19:19
Class to find 'average' image color.
<?php
/**
* imageColor
*
* Shows three methods to find the 'average' image color.
*
* Each function expects a gd image object.
*
* imageColor::averageResize($image) resizing to 1px, and checking the color.
* imageColor::averageBorder($image) find the average color of all border pixels.