Skip to content

Instantly share code, notes, and snippets.

View nearbycoder's full-sized avatar
:octocat:
Enjoying GitHub | Chrome Plugin free

Josh Hamilton nearbycoder

:octocat:
Enjoying GitHub | Chrome Plugin free
View GitHub Profile
@nearbycoder
nearbycoder / cloudSettings
Created July 7, 2018 17:45
Visual Studio Code Settings Sync Gist
{"lastUpload":"2018-07-07T17:45:22.635Z","extensionVersion":"v2.9.2"}

Keybase proof

I hereby claim:

  • I am nearbycoder on github.
  • I am nearbycoder (https://keybase.io/nearbycoder) on keybase.
  • I have a public key ASCntsGS9qR8gwzXBMYXdekBOaZHz2taaiq4M0S8DkQZnwo

To claim this, I am signing this object:

{
"Ansi 7 Color" : {
"Green Component" : 0.7333333492279053,
"Red Component" : 0.7333333492279053,
"Blue Component" : 0.7333333492279053
},
"Tags" : [
],
"Ansi 12 Color" : {
@nearbycoder
nearbycoder / cloudSettings
Last active July 9, 2020 21:09
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-07-09T21:09:15.629Z","extensionVersion":"v3.4.3"}
has_attached_file :image,
:styles => {original: '500x500#'}
validates_attachment_content_type :image, content_type: /\Aimage\/.*\Z/
@nearbycoder
nearbycoder / BlackjackAssist.exs
Last active July 19, 2016 16:53
simple module that helps divy up cards
defmodule BlackjackAssist do
@suits ~w(hearts clubs spades diamonds)
@values ~w(A 2 3 4 5 6 7 8 9 10 J Q K)
def draw_card do
{Enum.random(@suits), Enum.random(@values)}
end
def draw_card({:reshuffle}) do
draw_card
@nearbycoder
nearbycoder / swap.sh
Created June 30, 2016 16:59
Add Swap to Digital Ocean VM
#!/bin/sh
# size of swapfile in megabytes
swapsize=2048
# does the swap file already exist?
grep -q "swapfile" /etc/fstab
# if not then create it
if [ $? -ne 0 ]; then
@nearbycoder
nearbycoder / deleteswap.sh
Created June 30, 2016 16:58
Delete Swap from Digital Ocean VM
#!/bin/sh
# does the swap file exist?
grep -q "swapfile" /etc/fstab
# if it does then remove it
if [ $? -eq 0 ]; then
echo 'swapfile found. Removing swapfile.'
sed -i '/swapfile/d' /etc/fstab
echo "3" > /proc/sys/vm/drop_caches