Skip to content

Instantly share code, notes, and snippets.

View sabman's full-sized avatar
😀
Building, Shiping, Sharing!

Shoaib Burq sabman

😀
Building, Shiping, Sharing!
View GitHub Profile
@sabman
sabman / torchgeo_object_detection_example.ipynb
Created October 30, 2023 11:23 — forked from calebrob6/torchgeo_object_detection_example.ipynb
Short example of object detection training in TorchGeo.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sabman
sabman / H3_lut.sql
Created July 24, 2023 20:16 — forked from francois-baptiste/H3_lut.sql
Building a lookup table for spatial cloaking based on Uber’s Hexagonal Hierarchical Spatial Index, H3 with Bigquery
With T0 AS(
SELECT population, libjs4us.h3.ST_H3(ST_GEOGPOINT(longitude_centroid, latitude_centroid), 10) key FROM `bigquery-public-data.worldpop.population_grid_1km` WHERE last_updated = "2017-01-01"
),
T1 AS (
SELECT sum(population) population, key
from T0
group by key),
T2 AS (SELECT
array (SELECT
struct(libjs4us.h3.h3ToParent(key,len) as key, population) mystruct
@sabman
sabman / Gemfile
Created September 21, 2022 14:24 — forked from bosskovic/Gemfile
Devise as authentication solution for rails API
gem 'devise', '3.2.4'
gem 'simple_token_authentication', '1.5.0'
@sabman
sabman / spatialite_example.go
Created June 13, 2022 18:12 — forked from ptrv/spatialite_example.go
SpatiaLite example in Go
package main
import (
"database/sql"
"github.com/mattn/go-sqlite3"
"log"
"os"
)
func runQuery(db *sql.DB, query string) {
#!/bin/sh
# The least terrible way to resolve a symlink to its real path.
function realpath() {
/usr/bin/perl -e "use Cwd;print Cwd::abs_path(@ARGV[0])" "$0";
}
CONTENTS="$(dirname "$(dirname "$(dirname "$(dirname "$(realpath "$0")")")")")"
# BINARY_NAME="$(ls "$CONTENTS/MacOS/")"
BINARY_NAME="$(command ls --color=none "$CONTENTS/MacOS/")"
@sabman
sabman / info.json
Created November 23, 2021 20:01
TileJSON.io - wardboundaries_21610
{
"baseLayer": {
"tilejson": "2.2.0",
"name": "base",
"version": "1.0.0",
"scheme": "xyz",
"tiles": [
"https://a.tile.openstreetmap.org/{z}/{x}/{y}.png"
]
},
@sabman
sabman / bash_strict_mode.md
Created November 22, 2021 14:23 — forked from maxisam/bash_strict_mode.md
set -e, -u, -o, -x pipefail explanation

set -e, -u, -o, -x pipefail

The set lines

  • These lines deliberately cause your script to fail. Wait, what? Believe me, this is a good thing.
  • With these settings, certain common errors will cause the script to immediately fail, explicitly and loudly. Otherwise, you can get hidden bugs that are discovered only when they blow up in production.
  • set -euxo pipefail is short for:
set -e
set -u
@sabman
sabman / getting-going-best-practices.md
Created April 29, 2021 20:48 — forked from jbjonesjr/getting-going-best-practices.md
Getting Going and Best Practices Guide

GitHub Onboarding and Introduction

A guide for getting started and best practices for teams new to, or improving their interactions with, GitHub

image GitHub's features and capabilities

This document is meant to help new teams to GitHub familiarize themselves with the features and platform, as well as start to explore some of the best practices. While not a complete exploration, it's meant as a introduction to the key tenets of using GitHub for your business. For teams and organizations that desire more one on one support, GitHub Professional Services has many different options available to customize tools, training, and process to best meet your needs. The GitHub offerings listed in the diagram above are just a sampling of the various capabilities and we'd love to create a customized offering to meet your specific organizational needs.

Overview and Intr

@sabman
sabman / unique_chars.rs
Last active December 29, 2020 16:59 — forked from wunki/unique_chars.rs
Unique character check in Rust
use std::os;
fn unique_chars(s: &str) -> bool {
let v: Vec<char> = s.chars().collect();
let mut y = v.clone();
y.sort();
y.dedup();
v.len() == y.len()
}