Skip to content

Instantly share code, notes, and snippets.

View nhocki's full-sized avatar
💭
I may be slow to respond.

Nicolás Hock-Isaza nhocki

💭
I may be slow to respond.
View GitHub Profile
@nhocki
nhocki / README.md
Last active August 27, 2024 21:33
Reorder GitHub checks in pull requests to make it easier to find what failed.

Reorder GitHub Checks

This small extension will reorder GitHub checks in a GitHub pull request and place the successful checks at the bottom of the list. This is useful when you have a lot of checks and you want to see the failed checks first.

How to install

  1. Clone this Gist: git clone https://gist.github.com/ea9fcb036d9c099b42d2629116b1a642.git reorder-github-checks
@nhocki
nhocki / MyConnectedAppPlugin.cls
Last active November 2, 2023 21:22
Salesforce connected app plugin to add the AccountID to SAML attributes for community users
global class MyConnectedAppPlugin extends Auth.ConnectedAppPlugin {
global override Map<String,String> customAttributes(Id userId, Id connectedAppId, Map<String,String>
formulaDefinedAttributes, Auth.InvocationContext context) {
// Get the user's associated contact
User u = [SELECT Id, ContactId FROM User WHERE Id = :userId];
if(u.ContactId != null){
Contact c = [SELECT AccountId FROM Contact WHERE Id = :u.ContactId];
// Add the AccountId to your custom attributes map
formulaDefinedAttributes.put('organization_ids', c.AccountId);
}
@nhocki
nhocki / config.ini
Created September 4, 2022 02:15 — forked from orendon/config.ini
Visa appointment (renewal)
[USVISA]
; Account and current appointment info from https://ais.usvisa-info.com
USERNAME = YOUR_EMAIL
PASSWORD = YOUR_PASSWORD
SCHEDULE_ID = YOUR_ID
MY_SCHEDULE_DATE = YYYY-MM-DD
; Spanish - Colombia
COUNTRY_CODE = es-co
; Bogotá
FACILITY_ID = 26
This file has been truncated, but you can view the full file.
<?xml version="1.0" encoding="UTF-8"?>
<Settings soundProfile="1" mode="TWS">
<UISettings varName="ui" version="2" minQuestionDlgWidth="0" fontName="Verdana" bigScalePrices="false" bigScaleSizes="false" contractDisplay="true" delayForFilled="30" delayForCanceled="10" autoMeter="true" autoRemoveFinishedOrder="true" enableOrderSort="false" keyAdded="true" settlingAdded="false" colorText="false" showZeroPosition="true" showMoreOptions="false" showDVPZeroPosition="true" showAwayZeroPosition="true" displayServerTime="true" useLargeTextForServerTime="false" alwaysOnTop="false" flashBulletin="true" lastLoginDisplay="true" audit="true" autoRollover="true" useCondensedComboDesc="false" hideWorkspaceButtons="true" useOldOrderView="false" roundOrderSizes="false" volColumnsAdded="false" optionTraderVolColumnsAdded="true" showPricesOnVolatilityLayout="false" presetsColumnsAdded="false" scaleColumnsAdded="false" manualAwayColumnsAdded="false" clientCommissionColumnAdded="false" columnTips="true" highlightHighLow="false" s

Title

Authors:

  • @githubusername

1 TL;DR

@nhocki
nhocki / autoscaler.rb
Last active January 13, 2022 02:14
Most naive worker autoscaler for Heroku.
class Autoscaler
def initialize(app_name:, token: ENV["AUTOSCALE_TOKEN"])
@client = PlatformAPI.connect_oauth(token)
@app_name = app_name
end
def run!
puts "[Autoscaler] We currently have #{current_number_of_workers} workers and #{number_of_queued_jobs} jobs queued."
if number_of_queued_jobs > 0 && current_number_of_workers < 1
pipeline {
agent {
label 'build_node'
}
stages {
stage('run services pipelines') {
steps {
script {
parallel buildServices()
package main
import (
"log"
"os"
"os/signal"
"syscall"
"time"
"foo/bar/splice/ratelimiter"
@nhocki
nhocki / multi-arch.sh
Last active April 3, 2018 14:05
Modified https://github.com/stickermule/rump to use KEYS against an older Redis installation.
#!/usr/bin/env bash
VERSION="$1"
rm rump-*
GOOS=darwin GOARCH=amd64 go build -o rump-$VERSION-darwin-amd64 rump.go
GOOS=linux GOARCH=amd64 go build -o rump-$VERSION-linux-amd64 rump.go
GOOS=linux GOARCH=arm go build -o rump-$VERSION-linux-arm rump.go
GOOS=windows GOARCH=amd64 go build -o rump-$VERSION-windows-amd64 rump.go
@nhocki
nhocki / main.go
Created October 18, 2017 09:02
UUID generation tool
package main
import (
"fmt"
"github.com/mattetti/uuid"
)
func main() {
fmt.Println(uuid.GenUUID())