Skip to content

Instantly share code, notes, and snippets.

@countlurk
countlurk / round.go
Last active July 8, 2017 22:01
A function that rounds floats in Golang. Functionally equivalent to round() in Python 2 (rounds away from zero). Test it out here: https://play.golang.org/p/UpjhU7yXsc
package main
import (
"math"
)
func roundFloat(num float64, precision float64) float64 {
var power float64
var mod float64
var negative bool
@countlurk
countlurk / Tic-Tac-Toe.py
Last active November 28, 2016 16:33
Tic-Tac-Toe created by Pawtiko - https://repl.it/E4Jf/4
from sys import exit
'''
Key:
a1 | a2 | a3
b1 | b2 | b3
c1 | c2 | c3
@countlurk
countlurk / Square Root.py
Created October 5, 2016 21:10
Square Root created by Pawtiko - https://repl.it/DpAW/10
import math
number = eval(input("Enter a postive number: "))
lower = 0
#example: sqrt(0.5) is greater than 0.5
if number <= 1:
upper = number + 1
else:
upper = number
guess = 0
sqrt = 0

A Liberal Decalogue

by Bertrand Russell

  1. Do not feel absolutely certain of anything.

  2. Do not think it worthwhile to produce belief by concealing evidence, for the evidence is sure to come to light.

  3. Never try to discourage thinking, for you are sure to succeed.

  4. When you meet with opposition, even if it should be from your husband or your children, endeavor to overcome it by argument and not by authority, for a victory dependent upon authority is unreal and illusory.

@countlurk
countlurk / apachev2-2016.md
Last active September 1, 2016 21:15
MY Apache license for 2016

Copyright 2016 Patrick Callahan

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS,

@countlurk
countlurk / MIT2016.md
Last active August 27, 2016 15:53
My MIT license for 2016

The MIT License (MIT)

Copyright © 2016 Patrick Callahan

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH TH

@countlurk
countlurk / SimPL.md
Last active January 24, 2016 21:13
SimPL-2.0 (Disclaimer: Not my own creation)

Simple Public License (SimPL-2.0)


Preamble

This Simple Public License 2.0 (SimPL-2.0 for short) is a plain language implementation of GPL 2.0. The words are different, but the goal is the same - to guarantee for all users the freedom to share and change software. If anyone wonders about the meaning of the SimPL, they should interpret it as consistent with GPL 2.0.

Simple Public License (SimPL) 2.0