Skip to content

Instantly share code, notes, and snippets.

View hlecuanda's full-sized avatar
😡
Mirroring gitlab on ActiveGithub.NET 2019 Ultimate Enterprise EULA Live

H-Lo hlecuanda

😡
Mirroring gitlab on ActiveGithub.NET 2019 Ultimate Enterprise EULA Live
View GitHub Profile
@hlecuanda
hlecuanda / Git-Squash-Implementation.md
Last active April 7, 2024 02:46
Git Squash alias, from amazingly clean explanation on stackoverflow

From This other answer on the same thread

Based on Chris Johnsen's answer:

I added this line to the [alias] section of my git config file (~/.gitconfig):

squash = "!f(){ git reset --soft HEAD~${1} && git commit --edit -m\"$(git log --format=%B --reverse HEAD..HEAD@{1})\"; };f"
@hlecuanda
hlecuanda / README.md
Created October 28, 2016 17:28
Mapa de Mexico para colorear usando Google Charts JS API

Mapa de Mexico para colorear con google chars js api.

El archiv html va en tu documento, el JS puede cargarse afuera u antes de la llamada a los bloques html.

produce esto / your get tomething like this:

https://goo.gl/kPIMZR (jsfiddle)

Mapa de Mexico

@hlecuanda
hlecuanda / StackTraces-Logging-GAS.md
Last active May 3, 2023 09:30
Example using Stackdriver logging for debugging a custom function for sheets in Google Apps Script. / Writing a Caching custom function

Logging custom functions using stackdriver in google apps script

Recently, console logging became available for Google Apps Script projects. It used to be impossible to use the Log service that comes with the GAS runtime, but now all you need to do is throw an exception. Exceptions get logged in stackdriver logging and when enabled, unhandled exceptions will not stop your script execution. This adds up to nearly 0 lag if you are using this feature (?) by purposely throwing exceptions, and you can get creative with your error message to avoid having to expand stackdriver's log messages (which are pretty comprehensive stacktraces!)

Setup

@hlecuanda
hlecuanda / random-int
Created December 20, 2022 18:45
Get a random integer
#!/usr/bin/env python3
""" Prints a random integer to stdout
Usage:
random-int [NUMBER]
where NUMBER is any real number in the valid range for
int() or real() in python
Returns:
@hlecuanda
hlecuanda / GAS-Trigger-TestingFunction.gs
Created August 19, 2015 08:32
A pattern to debug google apps script (GAS) triggered functions.
/**
* Test function for onEdit. Passes an event object to simulate an edit to
* a cell in a spreadsheet.
*
* Check for updates: http://stackoverflow.com/a/16089067/1677912
*
* See https://developers.google.com/apps-script/guides/triggers/events#google_sheets_events
*
* on Script editor, set to debug THIS function, but create breakpoints
* on the onEdit Function
@hlecuanda
hlecuanda / ffmpegtips.txt
Created October 23, 2022 18:45 — forked from rabssm/ffmpegtips.txt
ffmpeg tips
# Interpolate video frames for a higher frame rate
ffmpeg -i source.mp4 -filter:v minterpolate -r 25 result.mp4
ffmpeg -i source.mp4 -vf minterpolate=50,tblend=all_mode=average,framestep=2 result.mp4
# Crop a video to the bottom right quarter
ffmpeg -i in.mp4 -filter:v "crop=in_w/2:in_h/2:in_w/2:in_h/2" -c:a copy out.mp4
# Resize a video to half size
ffmpeg -i input.mkv -filter_complex "scale=in_w/2:in_h/2" output.mkv
@hlecuanda
hlecuanda / downloa-all-images-bookmarklet.js
Last active April 28, 2022 20:46
A bookmarklet to download all images on a page, using the FileSystem API
javascript:(function(){
const run = async () => {
const dirHandle = await window.showDirectoryPicker();
const imgs = document.querySelectorAll("img");
let i = 0;
imgs.forEach(async (img) => {
const url = img.src;
const name = `img-${i}.png`;
WEBVTT
Kind: captions
Language: es
00:00:05.871 --> 00:00:07.673 align:start position:0% line:91%
<i> ( APLAUSOS )</i>
&gt;&gt; Stephen: HOLA A TODOS,
00:00:07.706 --> 00:00:11.244 line:85%
BIENVENIDOS DE NUEVO A "THE LATE SHOW".
@hlecuanda
hlecuanda / ix
Last active July 25, 2021 00:38
zsh implementation of the ix.io pastebin client
#!/usr/bin/env zsh
# _ _
# (_)_ __ (_) ___
# | \ \/ / | |/ _ \
# | |> < _| | (_) |
# |_/_/\_(_)_|\___/
# h@h-lo.me 20190927 144132 -0700 PDT 1569620492 d(-_- )b...
# Zsh implementation of the ix.io pastebin client. Now does more shit
# than the bash version ftw!
#
@hlecuanda
hlecuanda / python-requests-rapidamente.ipynb
Created October 20, 2020 21:33
Python Requests Rapidamente.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.