Skip to content

Instantly share code, notes, and snippets.

View kylebarron's full-sized avatar
👨‍💻

Kyle Barron kylebarron

👨‍💻
View GitHub Profile
@joar
joar / jq-insert-var.sh
Last active March 8, 2025 21:45
Add a field to an object with JQ
# Add field
echo '{"hello": "world"}' | jq --arg foo bar '. + {foo: $foo}'
# {
# "hello": "world",
# "foo": "bar"
# }
# Override field value
echo '{"hello": "world"}' | jq --arg foo bar '. + {hello: $foo}'
{
@mfuerstenau
mfuerstenau / zigzag-encoding.README
Last active April 24, 2025 05:25
ZigZag encoding/decoding explained
ZigZag-Encoding
---------------
Maps negative values to positive values while going back and
forth (0 = 0, -1 = 1, 1 = 2, -2 = 3, 2 = 4, -3 = 5, 3 = 6 ...)
(i >> bitlength-1) ^ (i << 1)
with "i" being the number to be encoded, "^" being
XOR-operation and ">>" would be arithemtic shifting-operation
@PurpleBooth
PurpleBooth / README-Template.md
Last active April 24, 2025 18:58
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@jqtrde
jqtrde / modern-geospatial-python.md
Last active August 1, 2023 14:50
Modern remote sensing image processing with Python
@gubatron
gubatron / compiling_building_c_cpp_notes.md
Last active April 15, 2025 16:19
Things to remember when compiling and linking C/C++ programs

Things to remember when compiling/linking C/C++ software

by Angel Leon. March 17, 2015;

Last update on December 14, 2023

Updated on February 27, 2023

Updated August 29, 2019.

# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.
@bquistorff
bquistorff / makefile
Created November 20, 2014 03:55
Makefile for a Stata project
# If you don't list all dependencies for code (because maybe it varies programmatically) then you can force a remake by doing 'make -B <target>. Note that it will remake all dependencies!
#nice-ness. Uncomment a line to enable. Default is +10
#nice_prefix := nice
#nice_prefix := nice -n10
############################# Project-specific Entries ####################
# which entries use parallel and need a windows gateway
# from $grep -r eval_synth . --include="*.do"
@bquistorff
bquistorff / gen-makefile.sh
Last active April 4, 2018 13:51
Generates a makefile keep Stata module installed files up-to-date with changes to the installation files
#!/bin/bash
#make a package-specific makefile
# Requirement: set the environment variable STATA_PLATFORM
# The platform names are:
# WIN (32-bit x86) and WIN64A (64-bit x86-64) for Windows;
# MACINTEL (32-bit Intel, GUI), OSX.X86 (32-bit Intel, console), MACINTEL64 (64-bit Intel, GUI), OSX.X8664 (64-bit Intel, console), MAC (32-bit PowerPC), and OSX.PPC (32-bit PowerPC), for Mac;
# LINUX (32-bit x86), LINUX64 (64-bit x86-64), SOL64, and SOLX8664 (64-bit x86-64) for Unix.
# To do: generate this automatically
@pschumm
pschumm / statab
Created October 7, 2014 00:06
Wrapper for "stata -b" which issues an informative error msg and appropriate (i.e., non-zero) return code
#! /bin/bash
# Wrapper for "stata -b" which issues an informative error msg and appropriate
# (i.e., non-zero) return code
# The basic idea for this script (including grepping the log file to determine
# whether there was an error) was taken from a similar script posted by Brendan
# Halpin on his blog at http://teaching.sociology.ul.ie/bhalpin/wordpress/?p=122
args=$# # number of args
@LeCoupa
LeCoupa / bash-cheatsheet.sh
Last active April 24, 2025 04:34
Bash CheatSheet for UNIX Systems --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04