Skip to content

Instantly share code, notes, and snippets.

@Eloi
Eloi / psyduck-testnet-metadata.json
Last active April 14, 2022 17:31
Psyduck Testnet Stake Pool
{
"name": "Psyduck Testnet Stake Pool",
"description": "Psyduck Stake Pool, testnet stake pool to test new capabilites and configurations for Cardano stake pools",
"ticker": "PSYT",
"homepage": "https://gist.github.com/Eloi/252bdfc5c414187774cc2d0ceba71c52"
}
@Eloi
Eloi / app\controllers\todo_list_controller.rb
Last active March 21, 2019 00:05
/app\controllers\todo_list_controller.rb
class TodoListsController < ApplicationController
before_action :set_current_user
def index
sort_by = params[:sort] || 'created_at'
sort_order = (params[:asc] == 'false') ? 'ASC' : 'DESC'
# COMMENT: Feeding unsanitized query params as string into the database is always A VERY BAD IDEA. Luckily in this example
# the attack vector seems restricted to the sorting, but who knows if there is any bug in the ActiveRecord order method
# that allows to widen the scale of the attach to a full SQL injection code.
#
@Eloi
Eloi / browser_automation.sh
Last active December 1, 2021 18:24
Simple shellscript to easily reload browser/terminal/other windows, without losing focus on the current window. Bind it to some useful key shortcut (p.e. win+r) to speed up web development process ;)
#!/bin/sh
if [ -n "$1" ]; then
if [ "$1" = "grab_id" ]; then
xdotool selectwindow >/tmp/autoreload_window_id
elif [ "$1" = "reload" ]; then
WINDOWID=`cat /tmp/autoreload_window_id`