Skip to content

Instantly share code, notes, and snippets.

@perrygeo
perrygeo / us_counties_geocoding.md
Created December 13, 2022 15:27
Geocoding US Counties with PostGIS

County/State level geocoding in postgis

If your geocoding task requires only US county and state level information, you can avoid a third party web service dependency using open data and postgis.

Data source

Natural Earth counties, US only.

@juliensagot
juliensagot / HostingView.swift
Created June 21, 2024 14:22
The missing UIHostingView
import SwiftUI
import UIKit
public final class HostingView: UIView {
public init(@ViewBuilder content: () -> some View) {
super.init(frame: .zero)
let contentView = UIHostingConfiguration(content: content)
.margins(.all, 0)
.makeContentView()
@raoofha
raoofha / hello.asm
Last active January 6, 2025 15:30
fasm hello world
; fasm demonstration of writing 64-bit ELF executable
; (thanks to František Gábriš)
; syscall numbers: /usr/src/linux/include/asm-x86_64/unistd.h
; parameters order:
; eax ; syscall_number
; rdi ; 1st param
; rsi ; 2nd param
; rdx ; 3rd param
; r10 ; 4th param
@owen2345
owen2345 / remote_file_renamer.rb
Last active January 6, 2025 15:28
activestorage rename already uploaded files (Rails rename activestorage) Local and AWS storage support
# frozen_string_literal: true
module Storage
class RemoteFileRenamer < ApplicationService
attr_reader :file_blob, :new_name, :file
# @param file [ActiveStorage::File]
# @param new_name [String]
# @param variation [Symbol] Sample: :thumbnail
def initialize(file, new_name, variation = nil)
@pbrilius
pbrilius / ide.sh
Last active January 6, 2025 15:37
Velnio tuzinas - le Luftwaffe!
#!/usr/bin/env sh
mkdir -vp $HOME/.local/bin
mkdir -pv $HOME/.local/env.d/scrib.d/x-path.d
touch $HOME/.local/env.d/scrib.d/x-path.d/matrix.inc.env.sh
touch $HOME/.local/env.d/scrib.d/x-path.d/pc.env.vevo.inc.sh
touch $HOME/.local/env.d/scrib.d/pentagon.nsa.inc.env.sh
touch $HOME/.local/env.d/aliases.oem.env.sh
touch $HOME/.local/env.d/scrib.d/f15.inc.env.sh
@belgattitude
belgattitude / ci-yarn-install.md
Last active January 6, 2025 15:22
Composite github action to improve CI time with yarn 3+ / node-modules linker.
@Klerith
Klerith / K8s.README.md
Last active January 6, 2025 15:18
Comandos que utilizaremos para configurar Kubernetes.

Helm commands

  • Crear configuración helm create <nombre>
  • Aplicar configuración inicial: helm install <nombre> .
  • Aplicar actualizaciones: helm upgrade <nombre> .

K8s commands

  • Obtener pods, deployments y services: kubectl get <pods | deployments | services>
  • Revisar todos pods: kubectl describe pods
@camh-
camh- / eol-at-eof.md
Created March 7, 2020 04:41
Please add newlines at end of files

See https://stackoverflow.com/questions/729692/why-should-text-files-end-with-a-newline

A newline in a text file is a terminator, not a separator. This means each line should have a newline at the end of it, including the last line of the file.

Many editors automatically add the newline at the end of the file. Some do not. If you can configure your editor to ensure there is always a newline at the end of every line, please do so.

Because many editors do add this newline, if you commit a text file without it, when someone else edits the file, their editor will (correctly) add the newline. This causes a spurious diff in the file. Spurious

@diego3g
diego3g / NODE.md
Last active January 6, 2025 15:15
VSCode Settings (Updated)

⚠️ Note!

With VSCode version 1.94, the APC extension broke and there is no fix yet.

So, for those having issues with APC after the VSCode update, I recommend downloading the previous version of VSCode for now (https://code.visualstudio.com/updates/v1_93) and setting updates to manual by adding this to the editor's configuration:

"update.mode": "manual",
@DaisukeMiyamoto
DaisukeMiyamoto / post_install_gpumon.sh
Last active January 6, 2025 15:12
set up CloudWatch GPU monitor for AWS ParallelCluster
#!/bin/bash -x
. /etc/parallelcluster/cfnconfig
nvidia-smi
if [ $? = 0 ] ; then
CLUSTER_NAME=$(echo ${stack_name} | sed -e "s/parallelcluster-//g")
sudo pip install boto3 pynvml
wget -P /tmp https://s3.amazonaws.com/aws-bigdata-blog/artifacts/GPUMonitoring/gpumon.py
sed \