Skip to content

Instantly share code, notes, and snippets.

View ogii's full-sized avatar

Aaron Clark ogii

View GitHub Profile
@ogii
ogii / check-array.sh
Created December 16, 2022 07:07
Iterate through an associative array in bash
declare -A channels=( ["mocha1"]="channel1" ["mocha2"]="channel2" ["mocha3"]="channel3")
for key in "${!channels[@]}"; do
if [ "$key" = "<< parameters.test-name >>" ]; then
echo "${channels[$key]}"
fi
done

Tweak your CircleCI server to build forked PRs even if the fork has an active CircleCI project

Overview

This instruction consists of 2 parts:

  1. Apply a patch to examine the special project flag.

  2. Set a special flag for projects which should run pipelines for every forked PRs.

@bradtraversy
bradtraversy / devcamper_specs.md
Last active May 9, 2024 21:07
Specs for Devcamper Udemy course project

DevCamper Backend API Specifications

Create the backend for a bootcamp directory website. The frontend/UI will be created by another team (future course). The html/css template has been created and can be used as a reference for functionality. All of the functionality below needs to be fully implmented in this project.

Bootcamps

  • List all bootcamps in the database
    • Pagination
    • Select specific fields in result
    • Limit number of results
  • Filter by fields

progrium/bashstyle

Bash is the JavaScript of systems programming. Although in some cases it's better to use a systems language like C or Go, Bash is an ideal systems language for smaller POSIX-oriented or command line tasks. Here's three quick reasons why:

  • It's everywhere. Like JavaScript for the web, Bash is already there ready for systems programming.
  • It's neutral. Unlike Ruby, Python, JavaScript, or PHP, Bash offends equally across all communities. ;)
  • It's made to be glue. Write complex parts in C or Go (or whatever!), and glue them together with Bash.

This document is how I write Bash and how I'd like collaborators to write Bash with me in my open source projects. It's based on a lot of experience and time collecting best practices. Most of them come from these two articles, but here integrated, slightly modified, and focusing on the most bang for buck items. Plus some ne

@excalq
excalq / gist:2961415
Last active March 19, 2024 17:45
Javacript: Set or Update a URL/QueryString Parameter, and update URL using HTML history.replaceState()
// 2024 Update, use URLSearchParams [https://caniuse.com/urlsearchparams]
export function createQueryString2(name: string, value: string, searchParams: any) {
const params = new URLSearchParams(searchParams);
params.set(name, value.toLowerCase());
return params.toString();
}
// ---- Original 2012 version, when browsers really sucked ----
// Explicitly save/update a url parameter using HTML5's replaceState().