My List
- cake
- satilites
- paper
Some code
ruby = "Ruby"
My first gist! | |
Arbitrary list: | |
- mountains | |
- electronics | |
- onions |
my_array = [1,2,3] | |
#Loop iteration | |
#--------------------- | |
for item in my_array do | |
p item | |
end | |
#--------------------- | |
# ------------------------- | |
# Treadmill Sort | |
# ------------------------- | |
# written in ruby 2.5.3 | |
# recursive | |
# ------------------------- | |
# reduces an array into its lowest value item | |
def min arr | |
if arr.length > 1 |
#____________ | |
#recursive pure arithmatic | |
#____________ | |
#length of a base10 number counting from 0 | |
def length n | |
Math.log10(n).floor | |
end | |
# Reduces an integer to its first digit eg. 321 #=> 3 | |
def get_first_digit n |
services = { | |
xserver = { | |
enable = true; | |
windowManager.xmonad.enable = true; | |
windowManager.xmonad.enableContribAndExtras = true; | |
desktopManager.default = "none"; | |
desktopManager.xterm.enable = false; | |
windowManager.default = "xmonad"; | |
}; | |
openssh.enable = true; |
Config { font = "xft:Bitstream Vera Sans Mono:size=9:regular:antialias=true" | |
, overrideRedirect = False | |
, borderColor = "#2C323C" | |
, border = TopB | |
, bgColor = "#21252B" | |
, fgColor = "#828997" | |
, position = TopW L 100 | |
, commands = [ Run Weather "CYVR" ["-t","<tempC>C","-L","18","-H","25","--normal","#98c379","--high","red","--low","lightblue"] 36000 | |
, Run Network "wlp2s0" ["-L","0","-H","32","--normal","#98c379","--high","#e06c75"] 10 | |
, Run Cpu ["-L","3","-H","50","--normal","#98c379","--high","#e06c75"] 10 |
// Pure Functional Matrix Operations | |
// built using partially applied curried functions | |
// I wrote function signatures with pseudo types to help me remember what things do | |
// All these functions gradually compose into ones capable various matrix operations | |
//--------------------------------------- | |
// BUILDING BLOCKS |