Skip to content

Instantly share code, notes, and snippets.

View evilthreads669966's full-sized avatar
💭
0x666

Chris Basinger evilthreads669966

💭
0x666
View GitHub Profile
@evilthreads669966
evilthreads669966 / CentralTendencyMeasurements.scala
Created December 3, 2023 00:18
central tendency measurements calculator
import scala.util.Sorting
import scala.collection.mutable.Map
@main
def main(): Unit = {
val list = List(26,0,5,8,20,22,0,13,6)
println(list.toCentralTendencyMeasures())
}
@evilthreads669966
evilthreads669966 / FiveNumberSummary.scala
Last active November 29, 2023 19:40
Five number summary calculator
import scala.io.StdIn.readLine
import scala.util.Sorting
import scala.math.floor
import scala.util.control.Breaks.{break, breakable}
@main
def main(): Unit = {
while true
do
breakable{
println("Enter a set of numbers separated by commas")
@evilthreads669966
evilthreads669966 / DrawAndCheckIfLineIsFunction.kt
Last active November 23, 2023 16:40
draw a line and check if it's a function
import kotlin.math.abs
import kotlin.math.sign
import kotlin.properties.Delegates
fun main() {
println("Do you want to draw a lineor check whether a line is a function?")
loop@while(true){
println("Enter draw or function")
val input = readlnOrNull()?.trim()
if(input.isNullOrBlank()) continue
@evilthreads669966
evilthreads669966 / Fraction.kt
Last active November 20, 2023 21:38
fraction math
import java.util.*
import java.util.concurrent.ConcurrentHashMap
import java.util.concurrent.Executors
import java.util.concurrent.Future
import java.util.concurrent.ThreadPoolExecutor
import kotlin.math.abs
fun main(){
while(true){
println("Enter for example 1/2 + 2/5")
@evilthreads669966
evilthreads669966 / Slope.kt
Last active November 19, 2023 01:10
line slope
import java.util.*
import java.util.concurrent.ConcurrentHashMap
import java.util.concurrent.Executors
import java.util.concurrent.Future
import java.util.concurrent.ThreadPoolExecutor
import kotlin.math.abs
fun main(){
val pointA = Point(0,4)
val pointB = Point(-2,5)
@evilthreads669966
evilthreads669966 / EvilSchedulingExampleUsage.txt
Last active November 13, 2023 18:33
Example usage of Evil Scheduling
_____ _ _ _____ _ _ _ _
| ___| (_) | / ___| | | | | | (_)
| |____ ___| | \ `--. ___| |__ ___ __| |_ _| |_ _ __ __ _
| __\ \ / / | | `--. \/ __| '_ \ / _ \/ _` | | | | | | '_ \ / _` |
| |___\ V /| | | /\__/ / (__| | | | __/ (_| | |_| | | | | | | (_| |
\____/ \_/ |_|_| \____/ \___|_| |_|\___|\__,_|\__,_|_|_|_| |_|\__, |
__/ |
|___/
Enter one of the following options:
@evilthreads669966
evilthreads669966 / EvilScheduling.kt
Last active November 14, 2023 20:52
appointment scheduling in the command line
import Appointments.entityId
import org.jetbrains.exposed.dao.IntEntity
import org.jetbrains.exposed.dao.IntEntityClass
import org.jetbrains.exposed.dao.id.EntityID
import org.jetbrains.exposed.dao.id.IntIdTable
import org.jetbrains.exposed.sql.Database
import org.jetbrains.exposed.sql.SchemaUtils
import org.jetbrains.exposed.sql.SqlExpressionBuilder.eq
import org.jetbrains.exposed.sql.and
import org.jetbrains.exposed.sql.transactions.transaction
@evilthreads669966
evilthreads669966 / SchedulingAppUsage.txt
Last active November 12, 2023 18:07
scheduling app example usage
_____ _ _ _____ _ _ _ _
| ___| (_) | / ___| | | | | | (_)
| |____ ___| | \ `--. ___| |__ ___ __| |_ _| |_ _ __ __ _
| __\ \ / / | | `--. \/ __| '_ \ / _ \/ _` | | | | | | '_ \ / _` |
| |___\ V /| | | /\__/ / (__| | | | __/ (_| | |_| | | | | | | (_| |
\____/ \_/ |_|_| \____/ \___|_| |_|\___|\__,_|\__,_|_|_|_| |_|\__, |
__/ |
|___/
Enter one of the following options:
Persons
@evilthreads669966
evilthreads669966 / firefox_browser_history.rb
Created November 11, 2023 02:00
get the browser history for firefox
#!/usr/bin/ruby
require 'sqlite3'
db_file = `find ~ -name places.sqlite | grep firefox`
unless db_file.empty?
db = SQLite3::Database.open db_file
db_history = db.execute "SELECT * FROM moz_places"
db.close
puts db_history
@evilthreads669966
evilthreads669966 / BlackJack.kt
Last active November 8, 2023 19:52
heads up blackjack game
import org.koin.core.component.KoinComponent
import org.koin.core.component.inject
import org.koin.core.context.startKoin
import org.koin.core.qualifier.named
import org.koin.dsl.module
fun main(){
startKoin {
modules(appModule)
}