Skip to content

Instantly share code, notes, and snippets.

View todgru's full-sized avatar

todgru

  • Portland, OR
View GitHub Profile
@todgru
todgru / elasticsearch-setup-apple-macbook-pro-m1.md
Created February 9, 2023 23:52
Install Elasticsearch 7.x on Apple Macbook Pro M1 Ventura 13.2

Elasticsearch Setup Apple MacBook Pro M1

Apple MacBook Pro M1, 32 GB, Ventura 13.2

Documentation based on comments in this Github Elasticsearch issue.

Install Homebrew

@todgru
todgru / aws-ec2-redis-cli.md
Created June 12, 2014 23:01
AWS redis-cli on EC2
@todgru
todgru / docker-audio-mac-m1.md
Last active April 8, 2024 19:56
Audio/sound from Docker container on M1 MacBook PRO 2019

Audio/sound from Docker container on M1 MacBook PRO 2019

Install pulseaudio with brew

brew install pulseaudio

NOTE: do not run pulseaudio as service wth brew. If started, stop the service.

@todgru
todgru / starttmux.sh
Last active March 3, 2024 15:40
Start up tmux with custom windows, panes and applications running
#!/bin/sh
#
# Setup a work space called `work` with two windows
# first window has 3 panes.
# The first pane set at 65%, split horizontally, set to api root and running vim
# pane 2 is split at 25% and running redis-server
# pane 3 is set to api root and bash prompt.
# note: `api` aliased to `cd ~/path/to/work`
#
session="work"
@todgru
todgru / ad7c_vfo_i2c.ino
Created December 27, 2013 05:24
AD7C's AD9850 DDS and Arduino VFO. Modification for use with I2C LCD. (Note: ForceFreq is set to 1.) Requires FMalpartida's I2C lcd libraries: https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home I2C discovery and setup: http://forum.arduino.cc/index.php/topic,128635.0.html
/*
Main code by Richard Visokey AD7C - www.ad7c.com
Revision 2.0 - November 6th, 2013
Updated with LCD I2C by Todd Gruener K7KXI
*/
// Include the library code
#include <Wire.h>
#include <LCD.h>
#include <LiquidCrystal_I2C.h>
@todgru
todgru / get.js
Created May 21, 2020 22:01
vanilla javascript version of lodash get
/**
* The behaves the same as the lodash version https://www.npmjs.com/package/lodash.get
*
* Source: https://github.com/you-dont-need/You-Dont-Need-Lodash-Underscore#_get
*/
const get = (obj, path, defaultValue = undefined) => {
const travel = regexp =>
String.prototype.split
.call(path, regexp)
.filter(Boolean)
@todgru
todgru / git-diff-file-name.md
Created February 7, 2024 23:57
Specify differences between to branches and only files with a certain name:

Specify differences between to branches and only files with a specific filename:

git diff topic..main -- './file1.txt' '**/file1.txt'
@todgru
todgru / git-rebase-interactive.md
Last active December 18, 2023 02:30
git interactive rebase

#Git Interactive Rebase

Scenario: We have a topic branch we've been working on. We want to combine the last few commits into one single commit. Our intention is to merge this topic branch, with one clean commit, into our main dev branch.

Solution: Git Rebase Interactive

Checkout your topic branch and look at your commit history:

$ git checkout topic-branch
@todgru
todgru / rebase.md
Last active September 26, 2023 00:25
git rebase interactive remove commit

#git rebase -i <sha>

List of commits from git log

F--E--D--C--B--A

Lets say you want to remove commit D from the commits.

git rebase -i E

@todgru
todgru / jq.md
Created September 6, 2023 14:43
jq cheat sheet cli shell json parsing

jq

$ echo '{"foo": "bar", "biz": "baz"}' | jq -r '.[]'
bar
baz