Skip to content

Instantly share code, notes, and snippets.

View sunsetsonwheels's full-sized avatar

Nam sunsetsonwheels

View GitHub Profile
@sunsetsonwheels
sunsetsonwheels / RiggedRockPaperScissors.py
Created October 22, 2018 00:04
RIgged Rock Paper Scissors (MCC 2018)
#Replace with the list of variables
games = ["O L", "O W", "[] D", "O L", "[] D", "O D", "[] L", "[] D", "O W", "[] D", "[] W", "[] D", "O W", "8< L", "8< L", "8< W", "O W", "O L", "O W", "[] L", "[] W", "[] L", "8< D", "[] L", "8< D", "O L", "O L", "[] W", "[] D", "O W", "O D", "[] L", "8< L", "8< D", "O L", "8< L", "[] D", "O L", "[] L", "[] W", "O D", "O L", "O L", "[] L", "[] W", "O L", "O D", "8< D", "8< D", "[] D", "O L", "[] D", "O D", "[] D", "O L", "O W", "8< W", "O W", "8< W", "[] D", "O L", "O W", "O D", "8< L", "O L", "[] D", "[] W", "[] L", "8< W", "O L", "[] D", "8< L", "O D", "[] W", "8< D", "8< D", "8< L", "O L", "[] W", "O L", "[] L", "[] W", "O D", "O L", "O D", "[] D", "[] W", "O L", "O D", "O D", "[] W", "[] L", "8< D", "[] D", "O D", "[] W", "[] W", "O D", "[] W", "O D", "O W", "8< W", "[] D", "[] W", "O W", "[] L", "8< D", "8< L", "[] D", "8< W", "8< D", "8< L", "O L", "8< L", "[] L", "O L", "8< L", "[] D", "O D", "[] L", "O L", "O L", "[] W", "8< L", "[] D", "[] D", "8< L", "8< D", "8<
@sunsetsonwheels
sunsetsonwheels / LookAndSaySequence.py
Created October 22, 2018 00:14
Look and Say Sequence (MCC 2018)
#Input the string here(renamed to stre to avoid conflict)
stre = "2447223522885338847799391928442276611848335958837719966312339882255338863322986779969779778814944544661225529911669955811799225855446671388642551449985992267743388558661966992211556676179983388776613688439947764433665885593885774425577115588933525533521557998899786292274366882775599664135997239932255811833687788226679977667733223366885133554882944244224411668442784883811483322833847755883328711278994955144937933225521772788542232992355448822992291886357692667733668559129353624244296699553221194433218851158677223377144557749481445445541411997799743311893447177188577615445518899116338822166112833448511266114557183366844898833977448453349984579944711557745533972116638844388233734485998844642554499223328866355883644699447755343443392211461625523374428854133966216688667744844811776633886655937734899799112361199377954993377495584433172882553369922556676998872255229811731447799332217722866177997443889338868552276477223661162334488548114998221199113764
from tkinter import Tk, messagebox, W, E, Menu
from tkinter.ttk import Button, Entry
from sys import exit
from threading import Thread
from webview import create_window
def start_thread(function):
t = Thread(target=function)
t.start()
@sunsetsonwheels
sunsetsonwheels / home.html
Created June 21, 2019 02:26
[KaiOS] I can't navigate the option menu!
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,user-scalable=no,initial-scale=1">
<title>Runner</title>
<link rel="stylesheet" href="/css/window.css"/>
<link rel="stylesheet" href="/css/home.css"/>
<link rel="manifest" href="/manifest.webapp"/>
<link rel="localization" href="/locales/runner.{locale}.properties"/>
var optionMenuOpen = false;
var optionMenuIndex = 0;
document.addEventListener("DOMContentLoaded", () => {
});
function backHandler() {
if(optionMenuOpen) {
document.getElementById("optionMenu-blur").style.display = "none";
document.getElementById("optionMenu").style.display = "none";
from gpiozero import MCP3008, LED, Button
from time import localtime, sleep
from lcddriver import lcd
from json import load
from os import getcwd
from os.path import join
from pyowm import OWM
print("-------------------------------------------------------------")
print("-------------------------------------------------------------")
@sunsetsonwheels
sunsetsonwheels / test.html
Created August 10, 2019 13:18
'Pages' nav in KaiOS
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,user-scalable=no">
<title>"Pages" in KaiOS</title>
<link rel="stylesheet" href="./window.css">
</head>
<body>
<header class="header">
@sunsetsonwheels
sunsetsonwheels / keybase.md
Created February 10, 2020 12:40
keybase.md

Keybase proof

I hereby claim:

  • I am jkelol111 on github.
  • I am jkelol111 (https://keybase.io/jkelol111) on keybase.
  • I have a public key ASAibMXKguaiM71tVV9Y6JjRYe4FHeEJcRVx0SzgVHs3gQo

To claim this, I am signing this object:

@sunsetsonwheels
sunsetsonwheels / Music.swift
Created July 29, 2021 02:28
macOS Monterey Music.app ScriptingBridge
import AppKit
import ScriptingBridge
@objc public protocol SBObjectProtocol: NSObjectProtocol {
func get() -> Any!
}
@objc public protocol SBApplicationProtocol: SBObjectProtocol {
func activate()
var delegate: SBApplicationDelegate! { get set }
@sunsetsonwheels
sunsetsonwheels / Scriptable iCloud Data.js
Created October 3, 2021 15:52
Scriptable iCloud Data
const fileManager = FileManager.iCloud();
const dataDirectoryPath = fileManager.joinPath(fileManager.documentsDirectory(), "data");
if (!fileManager.isDirectory(dataDirectoryPath)) fileManager.createDirectory(dataDirectoryPath);
function concatPath(fileName) {
return fileManager.joinPath(dataDirectoryPath, fileName);
}
module.exports.doesFileExist = (fileName) => {