Skip to content

Instantly share code, notes, and snippets.

View voising's full-sized avatar

Guillaume Voisin voising

View GitHub Profile
@voising
voising / app.css
Last active December 18, 2015 13:10
COFFESCRIPT : Ergonomics on forms
.focus {
color: #DEDEDE;
}
.hidden {
visibility: hidden;
}
@voising
voising / ergo.js
Last active December 18, 2015 13:18
JQUERY : Ergonomics on forms #jsergo
// JS
$('.ergo input, .ergo textarea').each(function() {
var label = $(this).parent().find('label[for="' + this.id + '"]');
$(this).on('focus', function() {
label.addClass("focus");
});
$(this).on('keydown', function() {
label.addClass("hidden");
});
@voising
voising / footer.html
Created June 15, 2013 15:24
HTML : Call Google jQuery and use local if necessary
@voising
voising / gists_to_dash_db.rb
Last active October 21, 2021 21:32
Connect Gists with Dash (Code Snippet Manager)
#!/usr/bin/env ruby
if ARGV[0].nil? || ARGV[0].match(/-h/)
puts "Usage : #{$0} github_username dash_sqlite_db char_appended_to_keyword [no_comments]"
exit
end
require 'net/http'
require 'open-uri'
#require 'awesome_print'
@voising
voising / list.php
Last active December 18, 2015 13:29
PHP : list a directory #listdir
<?php
$files = scandir(__dir path__);
$filesChoice = array();
foreach ($files as $val):
if ($val[0] != ".")
$filesChoice[$val] = $val;
endforeach;
asort($filesChoice);
?>
@voising
voising / click.js
Created June 15, 2013 23:10
JS : Trigger click on element, works with IE, iPad.. #forceClick
function forceClick(strSearch) {
var el = $(strSearch).get(0);
var evt = document.createEvent("MouseEvents");
evt.initMouseEvent("click", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
el.dispatchEvent(evt);
}
@voising
voising / anim.js
Created June 15, 2013 23:16
JQUERY : Animation after fadeOut #fadeoutlast
// The fadeOut() callback execute the function for each element. Sometimes we just need the function to be executed on the last element
lis = $('#menu li');
var i = lis.length;
lis.fadeOut(300, function(){
if (!--i) {
$('#element_to_animate').slideDown(300);
}
});
@voising
voising / Gemfile
Created June 15, 2013 23:18
RUBY : Gems for development #devgems
gem 'meta_request'
gem "better_errors"
gem "binding_of_caller"
gem 'awesome_print'
@voising
voising / append_this_to_url
Created June 15, 2013 23:23
SECURITY : Test if expose_php is on #testcreditsphp
?=PHPB8B5F2A0-3C92-11d3-A3A9-4C7B08C10000
@voising
voising / crawl.rb
Last active December 19, 2015 06:18 — forked from jico/crawl.rb
Crawl website links #crawl
require 'net/http'
require 'uri'
if ARGV[0].nil?
puts "Usage : #{$0} url [output] "
exit
end
class Crawler
attr_reader :url_list