Skip to content

Instantly share code, notes, and snippets.

View nam20485's full-sized avatar

Nathan Miller nam20485

View GitHub Profile
@nam20485
nam20485 / Visual Studio solution file headers+
Last active February 16, 2021 14:11
Visual Studio solution file headers - 2003, 2005, 2008, 2010, 2012, 2013, 2015, 2017, 2019
== Visual Studio .NET 2003 (DO NOT COPY THIS LINE) ==
Microsoft Visual Studio Solution File, Format Version 8.00
# Visual Studio .NET 2003
VisualStudioVersion = 7.1
== Visual Studio 2005 (DO NOT COPY THIS LINE) ==
Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
VisualStudioVersion = 8.0
@nam20485
nam20485 / docker-repository-install.bash
Last active January 30, 2019 10:54
install docker from respository
#! /bin/sh
UBUNTU_RELEASE=bionic
sudo apt-get remove docker docker-engine docker.io containerd runc
sudo apt-get update
sudo apt-get install -qqy \
apt-transport-https \
ca-certificates \
curl \
@nam20485
nam20485 / gen_secret_key.py
Last active June 15, 2023 03:13
Python 3 generate secret key
python -c 'import random; result = "".join([random.choice("abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)") for i in range(50)]); print(result)'
#python -c 'import random; print "".join([random.choice("abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)") for i in range(50)])'
@nam20485
nam20485 / round_to_nearest_multiple.py
Last active August 1, 2018 15:42
Round a number x, to the nearest multiple of m
increment = 0.002
decimal_places = -3
def round_to_nearest_multiple(value, increment, decimal_places):
rounded_value = round(x*increment, decimal_places)/increment
return rounded_value
v = 45.901
m = 0.002
d = -3