Skip to content

Instantly share code, notes, and snippets.

View gabrielstuff's full-sized avatar

Gabriel gabrielstuff

View GitHub Profile
@gabrielstuff
gabrielstuff / diff.sh
Created July 5, 2011 20:55
How to diff on files
diff --exclude=".svn" -rq ~/mounts/www.example.com/ /var/www/www.example.com/
@gabrielstuff
gabrielstuff / sample.js
Created July 8, 2011 08:20
Hide and show the legend on mouseover
$(function(){
$(".img-profil").mouseover(function(e){
$(this).children('.interact').show();
});
$(".img-profil").mouseout(function(){
$(this).children('.interact').hide();
});
});
@gabrielstuff
gabrielstuff / replacement.sql
Created July 10, 2011 16:54
SQL for replacement string
update aul_posts set post_content = replace(post_content, "mystringtosearch", "mystringtoreplace")
@gabrielstuff
gabrielstuff / i18n_responder.rb
Created August 1, 2011 17:52
a simple test of rake middleware
class i18n_responder
def initialize(app)
@app = app
end
def call(env)
[200, {"content-Type" => "text/html"}, "Hello, World!"]
end
end
@gabrielstuff
gabrielstuff / accordeon.js
Created October 18, 2011 09:46
Accordeon
(function (c) {
var b = {
openClass: "enoise-accordion-open",
heightClosed: 100
};
var a = function (d, e) {
return function (g) {
var f = d.openClass;
g = g || e.first();
e.each(function (index, el) {
@gabrielstuff
gabrielstuff / function.php
Created October 28, 2011 10:06
Wordpress Theming by cookie
function set_newuser_cookie() {
if (!isset($_COOKIE['wp_exq_cookieTheming'])) {
setcookie('wp_exq_cookieTheming', rand(0,5), time()+60*5, COOKIEPATH, COOKIE_DOMAIN, false);
}
}
add_action( 'init', 'set_newuser_cookie');
/*based on some url : themes/exquiseV2/style/ */
/*Style_0.css */
/*Style_1.css */
@gabrielstuff
gabrielstuff / gist:1327164
Created October 31, 2011 09:19 — forked from mrdoob/gist:1325393
ffmpeg: recording the screen.
ffmpeg -f x11grab -b 1M -bt 2M -r 30 -s 512x512 -i :0.0+1,53 -an kinect.webm
@gabrielstuff
gabrielstuff / users_controller.rb
Created November 1, 2011 17:27
users_controller
class UsersController < InheritedResources::Base
actions :show, :update, :index
before_filter :authenticate_user!
has_scope :max_age
has_scope :min_age
has_scope :sex
has_scope :filter, :type => :array do |controller, scope, value|
value = value.delete_if{|x| x == "-1"}
@gabrielstuff
gabrielstuff / reset_db_password.sh
Created November 19, 2011 11:36
This little snippet helps to reset mysql root password
$ ps -ax
$ #Kill all the related mysql process and direct run the next lines#
$ sudo /usr/local/mysql/bin/mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
#direct log after execute bellow command#
$ mysql -u root
mysql > database mysql;
@gabrielstuff
gabrielstuff / dabblet.css
Created January 2, 2012 16:03 — forked from superkevin/dabblet.css
saucisse
/**
saucisse
*/
#titre {
font-family: arial;
margin-left : 20px;
color : gray;
}