Skip to content

Instantly share code, notes, and snippets.

View froi's full-sized avatar
🎯
Focusing

Froilán Irizarry Rivera froi

🎯
Focusing
View GitHub Profile
@froi
froi / documentation-pr-template.md
Created January 3, 2022 20:57
Documentation section of a pull request template

Documentation

Creating and maintaining documentation is increadibly important. When needed, as part of this PR you need to tackle this too.

  • Documentation was created. URL to docs:
  • Documentation was updated. URL to docs:
  • Changes did not need documentation updates.
@froi
froi / test-gpg.sh
Last active June 30, 2021 04:34
Command to test gpg key
#!/usr/bin/env sh
echo "1234" | gpg --no-use-agent -o /dev/null --local-user <KEYID> -as - && echo "The correct passphrase was entered for this key"
@froi
froi / init.lua
Last active April 28, 2021 16:11
Hammerspoon config
-- Streaming
hs.hotkey.bind({"alt", "ctrl"}, "S", function()
local win = hs.window.focusedWindow()
local f = win:frame()
local screen = win:screen()
local max = screen:frame()
f.x = max.x
f.y = max.y
f.w = 1920
@froi
froi / README.md
Last active July 30, 2020 01:55
playing-with-etajs

This is a quick and simple example on how we can use a template engine to create markdown strings for use in GitHub issues or Jira ticket.

Eta.js

Eta.js is a templating engine that embbeds Javascript syntax into the template it self. It seems super lite weight.

Why use it

When working with issues and PRs, a ton of the code we do are the message templates themselves. I think that extracting this into a template engine will clean up the business logic from the view logic (sound familiar 😉).

@froi
froi / find-bin-alias.sh
Created July 27, 2020 16:36
Shell alias to find binary file extensions.
alias findbin='find . -type f -not -path "./.git/*" -exec perl -MFile::Basename -e '\''print (-T $_ ? "" : (fileparse ($_, qr/\.[^.]*/))[2] . "\n" ) for @ARGV'\'' {} + | sort | uniq'
@froi
froi / get-repo-labels-generator.js
Last active July 8, 2020 22:17
Quick example of how to use a async generator to get a repository's labels
const { Octokit } = require('@octokit/rest');
const { throttling } = require('@octokit/plugin-throttling');
const OctokitThrottling = Octokit.plugin(throttling);
const octokit = new OctokitThrottling({
auth: "your-token",
throttle: {
onRateLimit: (retryAfter, options) => {
octokit.log.warn(
@froi
froi / README.md
Last active June 30, 2020 05:12
Simple Python Flask app to demonstrate the use of CORS with Flask-restful
@froi
froi / github-questionaire.md
Last active November 26, 2018 22:44
Github Questionaire

Prompt one

Company: Acme computers

Version control platform(s): Many GitHub Enterprise instances installed throughout the company by different teams. Acme Computers is trying to standardize on GitHub Enterprise and consolidate their GitHub usage onto a single instance. The company has many instances of other Git hosting solutions installed as well. Some are fully supported applications. Other instances are on machines under people's desks.

Customer requests:

  • Shrink large repository: Acme wants GitHub to help them shrink the large repository to a more manageable size that is performant for common Git operations. The large repo is a project that is high visibility with an aggressive roadmap. They request that we help them within the month. It's a large, monolithic repository.
@froi
froi / svn_to_git.rst
Created November 26, 2018 05:41 — forked from epicserve/svn_to_git.rst
Convert SVN Repositories to Git Repositories

Convert SVN Repositories to Git Repositories

This guide on how to convert an SVN repository to a git repository was mostly taken from John Albin Wilkins post on Converting a Subversion repository to Git.

1. Retrieve a list of all Subversion committers

:

@froi
froi / fetch_parse_json.js
Created October 19, 2018 03:17
Small snippet to parse json string that could be formatted in utf16le and still be able to consume json strings in utf8
const fetch = require('node-fetch');
const encoding = require('encoding');
fetch('https://open.gsa.gov/code.json')
.then(response => response.buffer())
.then(json => {
let text = {};
if(json.indexOf('\uFEFF', 0, 'utf16le') === 0 ) {
text = encoding.convert(json, 'utf8', 'utf16le');