Skip to content

Instantly share code, notes, and snippets.

View pablodz's full-sized avatar
🚀
9.99x Engineer

Pablo pablodz

🚀
9.99x Engineer
View GitHub Profile
@mattetti
mattetti / multipart_upload.go
Last active April 22, 2024 05:24
Example of doing a multipart upload in Go (golang)
package main
import (
"bytes"
"fmt"
"io"
"log"
"mime/multipart"
"net/http"
"os"
@danharper
danharper / background.js
Last active May 22, 2024 11:09
Bare minimum Chrome extension to inject a JS file into the given page when you click on the browser action icon. The script then inserts a new div into the DOM.
// this is the background code...
// listen for our browerAction to be clicked
chrome.browserAction.onClicked.addListener(function (tab) {
// for the current tab, inject the "inject.js" file & execute it
chrome.tabs.executeScript(tab.ib, {
file: 'inject.js'
});
});
@miguelsaddress
miguelsaddress / how-to-gource.sh
Created October 9, 2015 08:35
Install Gource in Ubuntu (gource.io)
#Install Gource in Ubuntu
========================
#Go to the folder.... and
#see http://tylerfrankenstein.com/code/install-gource-ubuntu-1010-visualize-git-repo
sudo apt-get update
sudo apt-get install libsdl2-dev libsdl2-image-dev libpcre3-dev libfreetype6-dev libglew-dev libglm-dev libboost-filesystem-dev libpng12-dev libsdl1.2-dev libsdl-image1.2-dev libtinyxml-dev
./configure
make
sudo make install
@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)])
}
@andrewmilson
andrewmilson / file-upload-multipart.go
Last active May 20, 2024 14:46
Golang multipart/form-data File Upload
package main
import (
"net/http"
"os"
"bytes"
"path"
"path/filepath"
"mime/multipart"
"io"
@jumarag
jumarag / Elimina_telemetria_y_aplicaciones_Windows10.bat
Last active May 30, 2024 17:07
Script bat que elimina telemetría y aplicaciones por defecto en Windows 10
@echo off
rem # ################################################################################################################################
rem # Script para eliminar aplicaciones por defecto en Windows 10 y mejorar la privacidad #
rem # Se eliminan todas las aplicaciones integradas incluido skype y onedrive #
rem # Cortana no se puede eliminar directamente pero si se puede modificar su ubicación para que el sistema no inicie la aplicación #
rem # ###############################################################################################################################
if not "%cd%"=="%windir%\system32" (
echo Debes ejecutarlo como Administrador.
echo Click derecho y "Ejecutar como administrador"
@mpneuried
mpneuried / Makefile
Last active May 4, 2024 13:46
Simple Makefile to build, run, tag and publish a docker containier to AWS-ECR
# import config.
# You can change the default config with `make cnf="config_special.env" build`
cnf ?= config.env
include $(cnf)
export $(shell sed 's/=.*//' $(cnf))
# import deploy config
# You can change the default deploy config with `make cnf="deploy_special.env" release`
dpl ?= deploy.env
include $(dpl)
@dstotijn
dstotijn / pcm2wav.go
Last active December 9, 2023 07:26
pcm2wav
package main
import (
"encoding/binary"
"io"
"log"
"os"
"github.com/go-audio/audio"
"github.com/go-audio/wav"
/* Proyecto2_rev1.21
* Nombre: Tarea 2 - Sistemas Digitales
* Módulo: Tiva Launchpad EK-TM4C123GXL
* Descripción:
* -Al presionar SW1 formar una "X" con 8 Leds
* -Al presionar SW2 formar una "Y"
* -Al presionar SW3 formar una "I"
* -Al presionar SW4 formar una "l" Una linea vertical de 3 leds al medio
* -Al presionar SW2 con SW4 formar una "L" pegado a la izquierda
*
@nikhita
nikhita / update-golang.md
Last active June 7, 2024 11:21
How to update the Go version

How to update the Go version

System: Debian/Ubuntu/Fedora. Might work for others as well.

1. Uninstall the exisiting version

As mentioned here, to update a go version you will first need to uninstall the original version.

To uninstall, delete the /usr/local/go directory by: