Skip to content

Instantly share code, notes, and snippets.

@Gerst20051
Gerst20051 / test_google_chrome_bookmarks.json
Created September 27, 2017 15:46
Test Google Chrome Bookmarks
[
{
"id": "0",
"title": "",
"children": [
{
"id": "1",
"title": "Root Folder 1",
"children": [
{
@Gerst20051
Gerst20051 / flatten.js
Last active November 3, 2023 01:19
Flatten JS Object Keys
function flatten(obj) {
const result = {};
for (const key of Object.keys(obj)) {
if (typeof obj[key] === 'object') {
const nested = flatten(obj[key]);
for (const nestedKey of Object.keys(nested)) {
result[`${key}.${nestedKey}`] = nested[nestedKey];
}
} else {
result[key] = obj[key];
@Gerst20051
Gerst20051 / age_counting.php
Created November 21, 2020 05:02
PHP Age Counting
<?php
// Your goal is to count how many items exist that have an age equal to or greater than 50, and print this final value.
$ch = curl_init('https://coderbyte.com/api/challenges/json/age-counting');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, 0);
$data = curl_exec($ch);
curl_close($ch);
@Gerst20051
Gerst20051 / yobit_automated_script.js
Last active April 1, 2023 08:39
YoBit.Net FreeCoins Script
$(function() {
var levels = [ 100, 10, 1, 0.1, 0.01, 0.001, 0.0001, 0.00001, 0.000001, 0.0000001, 0.00000001 ];
var readyRows = [], levelRows = [];
function isCaptchaVisible() {
return 0 < $('#window_captcha:visible').length;
}
function restoreRows() {
$('#freecoins_table > tbody > tr:hidden').show();
@Gerst20051
Gerst20051 / resume.json
Created March 5, 2023 08:18
JSON Resume
{
"basics": {
"name": "Andrew Gerst",
"label": "Senior Software Engineer"
}
}
@Gerst20051
Gerst20051 / settings.json
Last active December 8, 2022 11:18
VSCode User Settings (Passport MacBook)
{
"editor.cursorBlinking": "phase",
"editor.dragAndDrop": false,
"editor.fontSize": 16,
"editor.lineHeight": 26,
"editor.renderIndentGuides": false,
"editor.renderLineHighlight": "all",
"editor.renderWhitespace": "all",
"editor.tabSize": 2,
"files.exclude": {
@Gerst20051
Gerst20051 / Package Control.sublime-settings
Last active December 8, 2022 09:02
Personal MacBook Sublime Settings (Preferences and Package Control)
{
"in_process_packages":
[
],
"installed_packages":
[
"Advanced CSV",
"AdvancedNewFile",
"Alignment",
"All Autocomplete",
@Gerst20051
Gerst20051 / Package Control.sublime-settings.json
Last active December 8, 2022 08:58
Passport Sublime Plugins Repository
{
"installed_packages":
[
"Passport",
],
"repositories":
[
"https://rawgit.com/Gerst20051/a311cfc3a1c011d7aaf0f8cbeb0ea14b/raw/46397fc958810d39c66e482b6152ee4ef9566cc4/passport_sublime_plugins_repository.json"
],
}
@Gerst20051
Gerst20051 / watch.command.sh
Last active November 17, 2022 05:32
Bash Watch Command
# execute commands at a specified interval of seconds
function watch.command {
# USAGE: watch.commands [seconds] [commands...]
# EXAMPLE: watch.command 5 date
# EXAMPLE: watch.command 5 date echo 'ls -l' echo 'ps | grep "kubectl\\\|node\\\|npm\\\|puma"'
# EXAMPLE: watch.command 5 'date; echo; ls -l; echo; ps | grep "kubectl\\\|node\\\|npm\\\|puma"' echo date 'echo; ls -1'
local cmds=()
for arg in "${@:2}"; do
echo $arg | sed 's/; /;/g' | tr \; \\n | while read cmd; do
cmds+=($cmd)
@Gerst20051
Gerst20051 / docker-setup.sh
Last active September 26, 2022 18:24
Automate Docker Setup Script
#!/usr/bin/env sh
# ASCII: http://patorjk.com/software/taag/#p=display&f=Graffiti&t=Docker%20Setup%20Script
# SOURCE: https://gist.github.com/Gerst20051/bf1341448bd43f430761c1f8150fb1b7
function double_echo {
echo && echo
}
function newline {