View application.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.Turbo.StreamActions.advance_history = function () { | |
const url = new URL(this.getAttribute('url')) | |
window.Turbo.navigator.view.lastRenderedLocation = url | |
window.Turbo.navigator.history.push(url) | |
} |
View resume.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "https://raw.githubusercontent.com/jsonresume/resume-schema/v1.0.0/schema.json", | |
"basics": { | |
"name": "Adrien Siami", | |
"label": "Full-Stack Software Engineer | Tech advisor for good", | |
"email": "adrien@siami.fr", | |
"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": { |
View turbo_frame_history_controller.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// DISCLAIMER : You can now probably use `data-turbo-action="advance"` on your frame to perform what this controller is aiming to do | |
// https://turbo.hotwired.dev/handbook/frames#promoting-a-frame-navigation-to-a-page-visit | |
// 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 { |
View cop.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 ...) | |
PATTERN | |
def_node_matcher :blank_target?, <<-PATTERN | |
(pair {(sym :target) (str "target")} (str "_blank")) | |
PATTERN |
View gist:4054741
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while true; do curl -F 'back=my-account&email=lol@lol.com&passwd=lalala42&SubmitLogin=toto' 'http://demo-store.prestashop.com/en/index.php?controller=authentication' -H "Content-Type:application/x-www-form-urlencoded" &;done |
View test.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local_var.method_with_hash_and_block( | |
mandatory_param, | |
option_1: a, | |
option_2: blabla, | |
option_3: blablablablablabla, | |
option_4: bblablablablablablablabla, | |
option_5: bblablablabla) do |v| | |
d = v.bla | |
e = v.bla | |
end |
View example.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Model.where('my_string LIKE BINARY ?', "This is a Test String") |
View gist:2409377
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
class Dad | |
{ | |
public: | |
Dad() | |
{ | |
this->hello(); | |
} |
View gist:1307618
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Assuming you have Jquerified the page | |
// http://www.learningjquery.com/2009/04/better-stronger-safer-jquerify-bookmarklet | |
function deleteApp(tab, index) { | |
tab[index].click(); | |
setTimeout(function() { | |
$jq("input[name=remove]").click(); | |
setTimeout(function() { | |
$jq("input[name=ok]").click(); | |
if (tab[index + 1]) { |
NewerOlder