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 / AlternatingColorsOnRowGroups.gs
Last active March 13, 2020 03:10
Alternate colors and add a separator on column value change. Google Sheets Google Apps Script
/**
* @OnlyCurrentDoc Limits the script to only accessing the current spreadsheet.
*/
/**
* After installing, select a column where the values repeat on each row, for example
* a flattened table with dates, invoice numbers, and invoice lines. like this:
*
* Date |Invoice#| PartNo |Descr ....
* 2017-01-15 | 123456 | ACME-WCMCI-1 | ACME WHATCHAMACALLIT 1
@hlecuanda
hlecuanda / firebase_pre-request_script.js
Created November 28, 2019 02:30 — forked from moneal/firebase_pre-request_script.js
Postman pre-request script to create a Firebase authentication JWT header.
/**
* This script expects the global variables 'refresh_token' and 'firebase_api_key' to be set. 'firebase_api_key' can be found
* in the Firebase console under project settings then 'Web API Key'.
* 'refresh_token' as to be gathered from watching the network requests to https://securetoken.googleapis.com/v1/token from
* your Firebase app, look for the formdata values
*
* If all the data is found it makes a request to get a new token and sets a 'auth_jwt' environment variable and updates the
* global 'refresh_token'.
*
* Requests that need authentication should have a header with a key of 'Authentication' and value of '{{auth_jwt}}'
@hlecuanda
hlecuanda / prezto-container.zsh
Last active October 28, 2019 01:06
prezto-container control zsh function
#!/usr/bin/env zsh
local opts withvals
zmodload zsh/zutil || { <<< 'Requires zsh/zutil module to be available'; false; return }
[ -z $commands[docker] ] && { <<< 'Requires Docker'; false; return }
zparseopts -D -E -M -a opts -A withvals - \
h=hlp -help=h \
i: -image=i \
@hlecuanda
hlecuanda / Google_Colaboratory_backup.py
Created April 2, 2019 22:25 — forked from rdinse/Google_Colaboratory_backup.py
Simple Google Drive backup script with automatic authentication for Google Colaboratory (Python 3)
# Simple Google Drive backup script with automatic authentication
# for Google Colaboratory (Python 3)
# Instructions:
# 1. Run this cell and authenticate via the link and text box.
# 2. Copy the JSON output below this cell into the `mycreds_file_contents`
# variable. Authentication will occur automatically from now on.
# 3. Create a new folder in Google Drive and copy the ID of this folder
# from the URL bar to the `folder_id` variable.
# 4. Specify the directory to be backed up in `dir_to_backup`.
@hlecuanda
hlecuanda / explorando-el-sistema-con-python-3.ipynb
Last active March 20, 2019 05:26
Explorando el Sistema con Python 3
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@hlecuanda
hlecuanda / pypi.md
Created August 18, 2018 12:29 — forked from alex/pypi.md

Most downloaded projects

SELECT
  file.project,
  COUNT(*) as total_downloads,
FROM
  TABLE_DATE_RANGE(
    [the-psf:pypi.downloads],
    TIMESTAMP("20160114"),
@hlecuanda
hlecuanda / Cached-leftpad-custom-function.gs
Created May 31, 2018 23:29
Cached custom function for G Suite / Google Sheets in Apps Script
kch = CacheService.getDocumentCache(); // set up the cache service as a global object
function lp(num){
return ("0000" + num).slice(-2) // elegant
Utilities.sleep(500);
}
/**
* A function to left pad an integert with 0 if less than two digits
@hlecuanda
hlecuanda / Code.gs
Last active May 24, 2018 13:36
Custom formula in Google Apps Script (GAS) to extract the formula used in a cell (G Suite Sheets)
/**
* Extract formula from a cell
*
* @param {reference} a cell reference from which to extract the formula
* @return a string representation of the formula in {reference}
* @customfunction
*/
function CELLFORMULA(reference) {
var ss = SpreadsheetApp;

Keybase proof

I hereby claim:

  • I am hlecuanda on github.
  • I am hlecuanda (https://keybase.io/hlecuanda) on keybase.
  • I have a public key whose fingerprint is B67A 1066 07FB F278 7A74 1F18 8666 B944 3E6B 25DF

To claim this, I am signing this object:

@hlecuanda
hlecuanda / README.md
Last active February 12, 2018 21:43
Creates a script that stores current `zsh` state. Sourcing that script will reproduce that state on another shell. Awesome for "works for me" diagnostic kind of scenarios

NAME:

reporter

SYNOPSIS:

    source /path/to/reporter [all | aliases | bindings | completion | functions |
                     limits | options | variables | zstyles]

DESCRIPTION: