Skip to content

Instantly share code, notes, and snippets.

View clawfire's full-sized avatar
🐻
Being cool

Thibault Milan clawfire

🐻
Being cool
View GitHub Profile
@clawfire
clawfire / Move Wordpress.sql
Created November 13, 2011 12:30
Move Wordpress
UPDATE wp_options SET option_value = replace(option_value, 'http://www.old-domain.com', 'http://www.new-domain.com') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'http://www.old-domain.com','http://www.new-domain.com');
UPDATE wp_posts SET post_content = replace(post_content, 'http://www.old-domain.com', 'http://www.new-domain.com');
@clawfire
clawfire / gist:1391306
Created November 24, 2011 13:06
Update from homemade ati driver to officials ones
sudo apt-get update
sudo apt-get install fglrx-updates
@clawfire
clawfire / finances.js
Created January 16, 2012 17:05
Some finantial validation functions
/**
* Valide un IBAN via la methode des modulo 97.
* @descr Attention ne valide que la forme pas la validite bancaire
* @argument string iban
* @returns bool
*/
function validateIban (iban) {
const ibanValidationModulo = 97;
// On force les caractères alphabétiques en majuscule
<?php
$doc = fopen('./debug.log', 'w+b');
fwrite($doc, "GENERATED AT ".time()."\n\n");
require_once('./curl.php');
/**
*
*/
function APICALL($methode,$url,$data,$encod=null){
global $doc;
fwrite($doc, "Appel de la fonction APICALL\n");
@clawfire
clawfire / gist:1940014
Created February 29, 2012 11:02
Allow to edit accesskey and Disallow after
gsettings set org.gnome.desktop.interface can-change-accels true
gsettings set org.gnome.desktop.interface can-change-accels false
@clawfire
clawfire / .htaccess
Created May 1, 2012 14:43
New .htaccess for PancakeApp
Options +FollowSymlinks
RewriteEngine on
# On Rackspace and getting 404's? Uncoment this by removing the # :
# RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
<IfModule mod_rewrite.c>
@clawfire
clawfire / gist:2708860
Created May 16, 2012 08:59
install Gstreamer Codec
su -c 'yum install gstreamer-{ffmpeg,plugins-{good,ugly,bad{,-free,-nonfree}}}'
@clawfire
clawfire / bcrypt.class.php
Created June 7, 2012 08:23
Bcrypt Class
<?php
class Bcrypt
{
private $rounds;
public function __construct($rounds = 12)
{
if (CRYPT_BLOWFISH != 1) {
throw new Exception("bcrypt not supported in this installation. See http://php.net/crypt");
}
@clawfire
clawfire / text-shadow.sublime-snippet
Created July 24, 2012 08:46
Custom text-shadow sublime snippet, with a better effect
<snippet>
<content><![CDATA[
text-shadow:${1:0 -1px 0 rgba(0, 0, 0, 0.8)}, ${2:0 1px 0 rgba(255, 255, 255, 0.5)};
]]></content>
<tabTrigger>text-shadow</tabTrigger>
<scope>source.css</scope>
</snippet>
@clawfire
clawfire / functions.php
Created August 7, 2012 13:18
Don't display placeholder and image if there's no picture defined for a category
<?php
// unload the original one
remove_action( 'woocommerce_before_subcategory_title', 'woocommerce_subcategory_thumbnail');
// load mine
add_action( 'woocommerce_before_subcategory_title', 'woocommerce_subcategory_thumbnail_custom', 10);
if ( ! function_exists( 'woocommerce_subcategory_thumbnail_custom' ) ) {
function woocommerce_subcategory_thumbnail_custom( $category ) {
global $woocommerce;