This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ref: https://github.com/prasmussen/gdrive | |
# prerequisite: | |
# In google drive, setup your folder for storing the backups | |
# Then grab the code from the url e.g. https://drive.google.com/drive/folders/xxxxx where xxxxx is the code | |
# This code will be used later in the cron command, keep it secret, keep it safe | |
# install gdrive sync for backups | |
wget https://drive.google.com/uc?id=0B3X9GlR6EmbnQ0FtZmJJUXEyRTA -O /usr/local/bin/gdrive | |
chmod 755 /usr/local/bin/gdrive |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- l0 is the origin of the line | |
-- l is the direction of the line expressed as a normal vector (tbd: does it have to be normal? possibly not) | |
-- p0 is the origin of the plane | |
-- n is a vector orthogonal to the surface of the plane expressed as a normal vector (tbd: does it have to be normal? possibly not) | |
function vectorIntersectPlane(l0, l, p0, n) | |
-- we find d by substituting the equation for the line into the equation of the plane and solving for d | |
d = (p0 - l0):Dot(n) / l:Dot(n) -- distance along the line at which the line intersects the plane | |
-- the point of intersection is found by substituting the distance back into the line equation | |
-- p = dl + l0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local hashtable = (function() | |
local hashtable_mt = {} | |
hashtable_mt.__index = hashtable_mt | |
local primes = {53, 97, 193, 389, 769, 1543, 3079, 6151, 12289, 24593, 49157, 98317, 196613, 393241, 786433, 1572869, 3145739, 6291469, 12582917, 25165843, 50331653, 100663319, 201326611, 402653189, 805306457, 1610612741} | |
local empty = {} | |
function hashtable() | |
local ht = { | |
data = {}, |
OlderNewer