Skip to content

Instantly share code, notes, and snippets.

View kevin-miles's full-sized avatar
👋
AFK

kevin-miles

👋
AFK
View GitHub Profile
@kevin-miles
kevin-miles / test.txt
Created August 12, 2024 22:53
Test Gist created by assistant
This is a test Gist created using the provided GitHub token.
@kevin-miles
kevin-miles / test.txt
Created August 12, 2024 22:39
Test Gist
Testing GitHub token
@kevin-miles
kevin-miles / keybase.md
Created December 12, 2019 01:00
keybase.md

Keybase proof

I hereby claim:

  • I am kevin-miles on github.
  • I am kevinmiles (https://keybase.io/kevinmiles) on keybase.
  • I have a public key ASBd5S3E-IzBKUKRCvP3FXe9OeG_g44e7XoMKZyZtPmOiQo

To claim this, I am signing this object:

@kevin-miles
kevin-miles / maps.go
Created April 9, 2019 22:12
A tour of Go - Exercise: Maps
package main
import (
"golang.org/x/tour/wc"
"strings"
)
func WordCount(s string) map[string]int {
elements := strings.Fields(s)
elementMap := make(map[string]int)
@kevin-miles
kevin-miles / rpi3_setup.txt
Last active December 31, 2016 23:18
Raspberry Pi 3 setup
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
sudo apt-get clean
sudo rpi-update
@kevin-miles
kevin-miles / gist:78c002ec07658468cb5b
Created January 29, 2015 17:26
How do I run a Unix process in the background?
In Unix, a background process executes independently of the shell, leaving the terminal free for other work. To run a process in the background, include an & (an ampersand) at the end of the command you use to run the job. Following are some examples:
To run the count program, which will display the process identification number of the job, enter:
count &
To check the status of your job, enter:
ps
To bring a background process to the foreground, enter:
fg
If you have more than one job suspended in the background, enter:
fg %#
@kevin-miles
kevin-miles / gist:fc2e00b6c12c85ec74b8
Created January 29, 2015 16:38
Display linux distribution name and version
cat /etc/issue
"ycdn": "F", "ycompress": "F", "ycookiefree": "F", "ycsslink": "F", "ycsstop": "F", "ydns": "F", "ydom_access": "F", "ydupes": "F", "yemptysrc": "F", "yetag": "F", "yevents": "F", "yexpires": "F", "yexpressions": "F", "yexternal": "F", "yfavicon": "F", "yflush": "F", "yiframes": "F", "yimgnoscale": "F", "yjsbottom": "F", "ymincookie": "F", "ymindom": "F", "yminify": "F", "ymultipart": "F", "yno404": "F", "ynofilter": "F", "ynumreq": "F", "yopt_images": "F", "yopt_sprites": "F", "ypostloa": "F", "ypreload": "F", "yredirects": "F", "ysplit": "F", "yunder25": "F", "yxhr": "F", "yxhrmetho": "F"
ycdn
ycompress
ycookiefree
ycsslink
ycsstop
ydns
ydom_access
ydupes
@kevin-miles
kevin-miles / gist:196a397787b9c90ae8a9
Last active August 29, 2015 14:12
Dynamic Replacement of string parameters
//replaces a string's commas with spaces
var replacement = 'test';
//in my use i had a for loop that used the index to generate the value
//in this example if you had it in a loop it would replace each '$NUMBER' with 'test'
for(var i=0; i<5; i++){
final = final.split('$'+value).join(replacement);
}
@kevin-miles
kevin-miles / gist:375a485ab6909e9039a7
Created November 19, 2014 16:29
Sort array of javascript objects
var homes = [
{
"h_id": "3",
"city": "Dallas",
"state": "TX",
"zip": "75201",
"price": "162500"
}, {
"h_id": "4",
"city": "Bevery Hills",