Skip to content

Instantly share code, notes, and snippets.

View BuonOmo's full-sized avatar
🥊
—(ಠ益ಠ)ノ

Ulysse Buonomo BuonOmo

🥊
—(ಠ益ಠ)ノ
View GitHub Profile
@BuonOmo
BuonOmo / mass-archive-trello-columns.js
Last active November 5, 2020 17:56
Archive trello columns all at once (using web, or api)
function timeout(time = 200) {
return new Promise((resolve) => {
setTimeout(resolve, time);
})
}
/**
* Prepare archiving, making sure columns are the correct ones.
*
* @param contents every column names to treat (may be only a part)
@BuonOmo
BuonOmo / scrap-heroku-dataclips.js
Last active October 16, 2020 11:08
Retrieve every Heroku dataclips at once.
// Go to the dataclip listing (https://data.heroku.com/dataclips).
// Then execute this script in your console.
// Be careful, this will focus a new window every 4 seconds, preventing
// you from working 4 seconds times the number of dataclips you have.
// Retrieve urls and titles
let dataclips = Array.
from(document.querySelectorAll('.rt-td:first-child a')).
map(el => ({ url: el.href, title: el.innerText }))
  1. Install the ruby extension pack.
  2. bundle install --binstubs to have bin/<executable>
  3. create a launch.json and add the configuration:
    {
      "name": "TODO",
      "type": "Ruby",
      "request": "launch",
      "program": "${workspaceRoot}/bin/TODO",

"cwd": "${workspaceRoot}",

@BuonOmo
BuonOmo / pre-commit.zsh
Last active November 23, 2021 10:04
Git pre-commit hook that detects non-breaking spaces
#!/usr/bin/env zsh
# Look for non-breaking spaces hidden in code, refuse
# to commit if there are some. This hook depends on the
# great ripgrep (https://github.com/BurntSushi/ripgrep).
# You can use bash if you prefere it over zsh, and ag
# over rg.
! rg --colors 'match:bg:yellow' -C 1 ' ' $(git ls-files) && exit 0
@BuonOmo
BuonOmo / aws-dynamo-db-delete-all-items.zsh
Last active September 8, 2023 15:07
Delete all items in a dynamo db table
#!/usr/bin/env zsh
# I'm using jq to parse json. I really suggest using it.
# I'm using parallel for faster results, you could use xargs or a for loop if you don't have parallel.
main() (
set -eux
local options="--profile some-profile"
local key='id'
local table='table'
@BuonOmo
BuonOmo / talkie.js
Last active April 10, 2020 14:39
Hangout push to talk.
// ==UserScript==
// @name talkie
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Safe talking on hangout
// @author You
// @match https://hangouts.google.com/u/*/call/*
// @grant none
// ==/UserScript==
@BuonOmo
BuonOmo / most-starred-repos.sh
Last active January 16, 2020 14:51
Most starred public repositories on GitHub.
# Forked from: https://gist.github.com/jdennes/7013672.
#
# I improved the request output!
curl -G https://api.github.com/search/repositories \
--data-urlencode 'q=stars:>1000' \
--data-urlencode 'sort=stars' \
--data-urlencode 'order=desc' \
-H 'Accept: application/vnd.github.preview' \
| jq --raw-output '.items | .[] | (.full_name + " (" + (.stargazers_count | tostring) + ")")' \
| cat -n
@BuonOmo
BuonOmo / time_ago.sh
Last active July 7, 2023 12:42
Time ago in words within bash
#!/usr/bin/env bash
# Copyright (c) 2019 Ulysse Buonomo <buonomo.ulysse@gmail.com> (MIT license)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
@BuonOmo
BuonOmo / so-comment-newbie.md
Last active March 19, 2019 09:11
Some good way to reroute a newbie on stack overflow

The posted question does not appear to include any attempt at all to solve the problem. StackOverflow expects you to try to solve your own problem first, as your attempts help us to better understand what you want. Please edit the question to show what you've tried, so as to illustrate a specific roadblock you're running into in a mcve. For more information, please see ask and take the tour.

@BuonOmo
BuonOmo / emojis.sh
Last active March 28, 2024 14:54
A list of all UTF-8 emojis in bash or zsh
# Obtained with the code written in next file
emoji_grinning_face=😀
emoji_grinning_face_with_big_eyes=😃
emoji_grinning_face_with_smiling_eyes=😄
emoji_beaming_face_with_smiling_eyes=😁
emoji_grinning_squinting_face=😆
emoji_grinning_face_with_sweat=😅
emoji_rolling_on_the_floor_laughing=🤣
emoji_face_with_tears_of_joy=😂
emoji_slightly_smiling_face=🙂