Skip to content

Instantly share code, notes, and snippets.

View allisson's full-sized avatar
🏠
Working from home

Allisson Azevedo allisson

🏠
Working from home
View GitHub Profile
https://bitcoin-snapshots.jaonoct.us/
@whatisor
whatisor / resign-old-commits
Created July 22, 2022 13:53
Resign old commits
1. Find your good commit id : git log
2. git rebase --exec 'git commit --amend --no-edit -n -S' -i <your latest good commit id>
3. just save and quit when prompted
4. git push origin <branch name> --force
@gugsrs
gugsrs / create_sqs_sns.py
Last active May 7, 2019 20:47
Script to create SQS and SNS from yaml
#!/usr/bin/env python
import sys
import yaml
from subprocess import call
def main():
f = open(sys.argv[1])
data = yaml.load(f)
create_queues(data['Local']['Queues'])
@SanderTheDragon
SanderTheDragon / postman-deb.sh
Last active June 11, 2024 10:46
A shellscript to create a Postman .deb file, for simple installation on Debian-based Linux distro's. Also creates a .desktop file.
#!/bin/sh
# SPDX-FileCopyrightText: 2017-2024 SanderTheDragon <sanderthedragon@zoho.com>
#
# SPDX-License-Identifier: MIT
arch=$(dpkg --print-architecture)
echo "Detected architecture: $arch"
case "$arch" in
from django.contrib.admin import ModelAdmin
class MyTableAdmin(ModelAdmin):
...
paginator = LargeTablePaginator
...
@aviskase
aviskase / Postman.desktop
Last active November 21, 2023 20:56
Install Postman
[Desktop Entry]
Encoding=UTF-8
Name=Postman
Exec=postman
Icon=/home/USERNAME/Postman/app/resources/app/assets/icon.png
Terminal=false
Type=Application
Categories=Development;
@elliotchance
elliotchance / server.go
Last active May 30, 2020 18:40
A simple server in Go
package main
import (
"bufio"
"fmt"
"net"
)
func check(err error, message string) {
if err != nil {
@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@xlab
xlab / bytes_split.go
Last active April 4, 2022 17:21
Golang split byte slice in chunks sized by limit
func split(buf []byte, lim int) [][]byte {
var chunk []byte
chunks := make([][]byte, 0, len(buf)/lim+1)
for len(buf) >= lim {
chunk, buf = buf[:lim], buf[lim:]
chunks = append(chunks, chunk)
}
if len(buf) > 0 {
chunks = append(chunks, buf[:len(buf)])
}
@iamralch
iamralch / compress.go
Last active April 16, 2023 03:04
ZIP archives in Golang
import (
"archive/zip"
"io"
"os"
"path/filepath"
"strings"
)
func zipit(source, target string) error {
zipfile, err := os.Create(target)