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 / 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",
As screen is not maintained anymore you should look for modern alternatives like tmux.
tmux is superior for many reasons, here are just some examples:
Windows can be moved between session and even linked to multiple sessions
Windows can be split horizontally and vertically into panes
Support for UTF-8 and 256 colour terminals
Sessions can be controlled from the shell without the need to enter a session
Basic Functionality
@kevin-miles
kevin-miles / gist:78924bafdc56860deadf
Created November 10, 2014 15:53
browserstack breach email
Dear BrowserStack User,
We are unfortunately displeased to announce that BrowserStack will be shutting down. After much consideration on our part, we have realized we were negligent in the services we claimed to offer. In our terms of service, we state the following:
[...] after the restoration process is complete, the virtual machines are guaranteed to be tamper-proof.
[...] The machines themselves are in a secure network, and behind strong firewalls to present the safest environment possible.
[...] At any given time, you have sole access to a virtual machine. Your testing session cannot be seen or accessed by other users, including BrowserStack administrators. Once you release a virtual machine, it is taken off the grid, and restored to its initial settings. All your data is destroyed in this process.