Skip to content

Instantly share code, notes, and snippets.

View guifromrio's full-sized avatar

Guilherme Rodrigues guifromrio

View GitHub Profile
@trayvox
trayvox / L0.sol
Last active April 1, 2024 19:09
Example to show how LayerZero can rug all LP's if unverified contracts are malicious
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.10;
import {ERC20, SafeTransferLib} from "solmate/utils/SafeTransferLib.sol";
import {DSTestPlus} from "solmate/test/utils/DSTestPlus.sol";
struct Packet {
uint16 srcChainId;
uint16 dstChainId;
@lornajane
lornajane / mac.md
Last active May 9, 2024 01:22
Keyboard Only OS X

Keyboard-only Mac Cheatsheet

Hi, I'm Lorna and I don't use a mouse. I have had RSI issues since a bad workstation setup at work in 2006. I've tried a number of extra hardware modifications but what works best for me is to use the keyboard and only the keyboard, so I'm in a good position and never reaching for anything else (except my coffee cup!). I rather unwisely took a job which required me to use a mac (I've been a linux user until now and also had the ability to choose my tools carefully) so here is my cheatsheet of the apps, tricks and keyboard shortcuts I'm using, mostly for my own reference. Since keyboard-only use is also great for productivity, you may also find some of these ideas useful, in which case at least something good has come of this :)

Apps List

There's more detail on a few of these apps but here is a quick overview of the tools I've installed and found helpful

Tool Link Comments
@klzns
klzns / peixes
Created September 8, 2013 01:06
Trecho do livro O Apanhador no Campo de Centeio
O táxi que tomei era velho pra chuchu e cheirava como se alguém tivesse acabado de vomitar ali mesmo. Sempre que tomo um táxi de madrugada, tem que estar fedendo a vômito. E o pior é que a rua estava um bocado silenciosa e deserta, embora fosse uma noite de sábado. Não se via quase ninguém. Aqui e ali tinha um homem e uma mulher atravessando a rua, abraçados pela cintura e tudo, ou um grupo de imbecis com as namoradas, todos rindo como umas hienas de qualquer coisa que, aposto, não tinha a menor graça. Nova York é terrível quando alguém ri de noite na rua; pode-se ouvir a gargalhada a quilômetros de distância. É o tipo do troço que faz a gente se sentir só e deprimido. Continuava com vontade de ir para casa e fazer um pouco de hora com a Phoebe. Mas afinal, depois de algum tempo no táxi, eu e o chofer começamos a conversar. O nome dele era Horwitz. Era um sujeito muito mais simpático do que o outro motorista com quem eu tinha andado antes. Seja como for, pensei que ele talvez soubesse alguma coisa sobre os pa
@phette23
phette23 / current-dir-in-iterm-tab-title.sh
Last active January 4, 2024 10:20
Set the iTerm tab title to the current directory, not full path.
# put this in your .bash_profile
if [ $ITERM_SESSION_ID ]; then
export PROMPT_COMMAND='echo -ne "\033];${PWD##*/}\007"; ':"$PROMPT_COMMAND";
fi
# Piece-by-Piece Explanation:
# the if condition makes sure we only screw with $PROMPT_COMMAND if we're in an iTerm environment
# iTerm happens to give each session a unique $ITERM_SESSION_ID we can use, $ITERM_PROFILE is an option too
# the $PROMPT_COMMAND environment variable is executed every time a command is run
# see: ss64.com/bash/syntax-prompt.html
@ngauthier
ngauthier / README.md
Created July 5, 2012 20:10
Rdio "native" in linux

I like Rdio and linux. Rdio works great in a browser except for one thing: keyboard shortcuts!!!

When coding, I like to be able to play/pause my music quickly, meaning I don't want to switch windows. I figured out a way to do this:

Google Chrome --app

First, I made a file in my ~/bin called rdio that runs:

google-chrome --app=http://rdio.com
@isaacs
isaacs / node-and-npm-in-30-seconds.sh
Last active March 8, 2024 02:11
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh