Skip to content

Instantly share code, notes, and snippets.

Tony Colston tonetheman

Block or report user

Report or block tonetheman

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@tonetheman
tonetheman / wl.html
Created Feb 6, 2020
html to handle number controls
View wl.html
<!DOCTYPE html>
<html>
<head>
<meta name="viewport"
content="user-scalable=no, width=device-width" />
<style>
input {
border : 3px solid black;
padding : 2px;
@tonetheman
tonetheman / example_classic.lua
Created Feb 6, 2020
classic example for lua OO
View example_classic.lua
--[[
example of using
https://github.com/rxi/classic
]]
local Object = require("classic")
local Actor = Object:extend() -- new class
@tonetheman
tonetheman / example_classic.lua
Created Feb 6, 2020
classic example for lua OO
View example_classic.lua
--[[
example of using
https://github.com/rxi/classic
]]
local Object = require("classic")
local Actor = Object:extend() -- new class
View oli.py
import random
class Person:
def __init__(self,id):
self.amount = 100
self.id = id
def __repr__(self):
return str(self.id) + " :: " + str(self.amount)
# setup
@tonetheman
tonetheman / c.rkt
Created Dec 13, 2019
collatz in racket
View c.rkt
#lang racket
(define (foo n)
(if (= (modulo n 2) 0)
(/ n 2)
(+ (* 3 n) 1)
))
(define (goo a)
@tonetheman
tonetheman / workingunittest.rkt
Created Dec 3, 2019
working unit test setup
View workingunittest.rkt
#lang racket
(define a 10)
(module+ test
(require rackunit)
(check-equal? a 10 "making sure a is working")
)
@tonetheman
tonetheman / raytracing.rkt
Created Oct 27, 2019
first program in raytracing in a weekend in racket
View raytracing.rkt
#lang racket
(define nx 200)
(define ny 100)
(display (string-append "P3\n"
(number->string nx) " "
(number->string ny) "\n255\n"))
(for ([j (in-range (- ny 1) 0 -1)])
@tonetheman
tonetheman / readfile.nim
Created Sep 24, 2019
read a file with nim line by line
View readfile.nim
proc readwholefile() =
let data = readFile("data.txt")
echo(data)
proc justoneline() =
let f = open("data.txt")
defer: f.close()
let firstline = f.readLine()
echo(firstline)
@tonetheman
tonetheman / reallLong.py
Created Aug 25, 2019
Really long screenshot in Selenium... kind of full screen
View reallLong.py
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.chrome.options import Options
mobile_emulation = {
"deviceMetrics": {
"width": 1440, "height": 3*1440,
"pixelRatio": 2.0 },
@tonetheman
tonetheman / lies.py
Created Jul 30, 2019
weird thing about python
View lies.py
a = 1
b = 1
print(a,b,a is b)
a = 2
b = 2
print(a,b,a is b)
a = -6
You can’t perform that action at this time.