Skip to content

Instantly share code, notes, and snippets.

@anacampesan
anacampesan / gifFrameDisposal.js
Last active April 24, 2023 12:02
GIF Frame Disposal Correction Algorithm
function explodeGif(gifUrl) {
return gifler(gifUrl)._animatorPromise.then(function(gif) {
let current = createTempCanvas(gif.width, gif.height, 'current');
let currentCtx = current.getContext('2d');
let temp = createTempCanvas(gif.width, gif.height, 'temp');
let tempCtx = temp.getContext('2d');
gif._animationLength = 0;
for (let i = 0; i < gif._frames.length; i++) {
@aaronc
aaronc / key-management.md
Last active October 31, 2022 23:09
Key groups, msg and fee delegation from the Gaians team at Hackatom Berlin 2019

Fee delegation

The delegation module also allows for fee delegation via some changes to the AnteHandler and StdTx. The behavior is similar to that described above for Msg delegations except using the interface FeeAllowance instead of Capability:

// FeeAllowance defines a permission for one account to use another account's balance
// to pay fees
@rigelrozanski
rigelrozanski / imgcat.go
Created April 30, 2020 03:55
Iterm2 imgcat image output from golang
import (
"encoding/base64"
"fmt"
"io/ioutil"
"os"
)
func main() {
r, err := os.Open("yourimagehere.png")
if err != nil {
@clemensgg
clemensgg / gist:81307bded1b99d166c484049d0f5246c
Last active February 26, 2022 21:54
configure hermes relayer to use feegrant module for omniflix
# omniflix team are granting relayer accounts to pay fees from a specified 'granter' account
# fill out the relayer-coordination-sheet provided by the team to get your relayer account whitelisted (granted)
# works with hermes v0.11.0 and higher (https://github.com/informalsystems/ibc-rs)
# config.toml (set granter account, set your endpoints, comment out channels you don't relay)
[[chains]]
id = 'omniflixhub-1'
rpc_addr = 'http://...'
grpc_addr = 'http://...'
@0age
0age / c000r.sol
Last active June 10, 2024 18:32
0xMonaco car (top-ranked finisher by ELO, Paradigm CTF 2022) https://0xmonaco.ctf.paradigm.xyz/viewTeam/OpenSea
// SPDX-License-Identifier: MIT
pragma solidity 0.8.16; // (10M optimization runs)
interface MonacoInterface {
struct CarData {
uint32 balance; // Where 0 means the car has no money.
uint32 speed; // Where 0 means the car isn't moving.
uint32 y; // Where 0 means the car hasn't moved.
Car car;
}
@adrienbrault
adrienbrault / llama2-mac-gpu.sh
Last active April 8, 2025 13:49
Run Llama-2-13B-chat locally on your M1/M2 Mac with GPU inference. Uses 10GB RAM. UPDATE: see https://twitter.com/simonw/status/1691495807319674880?s=20
# Clone llama.cpp
git clone https://github.com/ggerganov/llama.cpp.git
cd llama.cpp
# Build it
make clean
LLAMA_METAL=1 make
# Download model
export MODEL=llama-2-13b-chat.ggmlv3.q4_0.bin