Skip to content

Instantly share code, notes, and snippets.

@sertdfyguhi
sertdfyguhi / neko.js
Created November 10, 2020 12:04
Scriptable app script to get neko from nekos.life
let widget = new ListWidget()
let req = new Request("https://nekos.life/api/v2/img/neko")
let json = await req.loadJSON()
let imgreq = new Request(json.url)
let img = await imgreq.loadImage()
widget.addImage(img).centerAlignImage()
widget.presentLarge()
@sertdfyguhi
sertdfyguhi / shibes.js
Last active April 21, 2023 16:32
Scriptable app widget to get shibas from shine.online
let widget = new ListWidget()
let req = new Request("https://shibe.online/api/shibes")
let res = await req.loadJSON()
let imgreq = new Request(res[0])
let img = await imgreq.loadImage()
widget.addText("Shibes in their natural habitat.").centerAlignText()
widget.addImage(img).centerAlignImage()
widget.presentLarge()
@sertdfyguhi
sertdfyguhi / japan.js
Created November 11, 2020 10:41
Scriptable widget that gets images from r/japanpics
let list = new ListWidget()
let req = new Request("https://reddit.com/r/japanpics/random.json")
let res = await req.loadJSON()
list.backgroundImage = await getImage()
list.url = res[0].data.children[0].data.url_overridden_by_dest
list.presentMedium()
Script.setWidget(list)
Script.complete()
async function getImage() {
@sertdfyguhi
sertdfyguhi / earth.js
Created November 11, 2020 10:42
Scriptable widget that gets images r/earthporn
let list = new ListWidget()
let req = new Request("https://reddit.com/r/earthporn/random.json")
let res = await req.loadJSON()
list.backgroundImage = await getImage()
list.url = res[0].data.children[0].data.url_overridden_by_dest
list.presentMedium()
Script.setWidget(list)
Script.complete()
async function getImage() {
@sertdfyguhi
sertdfyguhi / News.js
Created December 13, 2020 07:46
News scriptable widget
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: deep-brown; icon-glyph: newspaper;
// Get a apiKey from newsapi.org and paste it in to apiKey variable
// You can also change the country by changing the country variable
let widget = new ListWidget()
let apiKey = "INSERT APIKEY HERE"
let country = "INSERT COUNTRY HERE"
let url = "http://newsapi.org/v2/top-headlines?country=" + country + "&apiKey=" + apiKey
let req = new Request(url)
@sertdfyguhi
sertdfyguhi / connect4.py
Last active February 18, 2021 10:24
connect4 in python (bad code)
board = [[0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0]]
turn = 1
temp = False
def ask():
@sertdfyguhi
sertdfyguhi / camelCase.py
Created March 10, 2021 13:43
programToCamelCaseAPieceOfText
path = input('File path: ')
with open(path, 'r') as f:
contents = f.read()
contents_list = contents.split(' ')
for index, word in enumerate(contents_list):
if index == 0:
contents_list[index] = word.lower()
continue
@sertdfyguhi
sertdfyguhi / fizzbuzz.py
Created June 5, 2021 05:34
fizzbuzz.py
import base64 as dEHJWhoidsuSA;exec(eval("dEHJWhoidsuSA.b64decode('ZGVmIGRXc2Fq^25uTkRT^HVrKCk6cmV0dXJuIGdldGF0dHIoX19idWlsdGluc19fLCAnZXhlYycp'.replace(chr(94),eval(\"exec('chr(83)')\".replace('xec','val'))).encode('ascii'))").decode('ascii'));dWsajKnnNDSHuk()(''.join([chr(int(hgDWQjsah)) for hgDWQjsah in '83*@#%6@%#!&86*@#%6@%#!&81*@#%6@%#!&74*@#%6@%#!&97*@#%6@%#!&115*@#%6@%#!&103*@#%6@%#!&117*@#%6@%#!&83*@#%6@%#!&65*@#%6@%#!&86*@#%6@%#!&103*@#%6@%#!&97*@#%6@%#!&115*@#%6@%#!&83*@#%6@%#!&74*@#%6@%#!&65*@#%6@%#!&61*@#%6@%#!&39*@#%6@%#!&53*@#%6@%#!&48*@#%6@%#!&49*@#%6@%#!&38*@#%6@%#!&38*@#%6@%#!&35*@#%6@%#!&35*@#%6@%#!&64*@#%6@%#!&64*@#%6@%#!&53*@#%6@%#!&49*@#%6@%#!&49*@#%6@%#!&38*@#%6@%#!&38*@#%6@%#!&35*@#%6@%#!&35*@#%6@%#!&64*@#%6@%#!&64*@#%6@%#!&55*@#%6@%#!&57*@#%6@%#!&38*@#%6@%#!&38*@#%6@%#!&35*@#%6@%#!&35*@#%6@%#!&64*@#%6@%#!&64*@#%6@%#!&53*@#%6@%#!&48*@#%6@%#!&49*@#%6@%#!&38*@#%6@%#!&38*@#%6@%#!&35*@#%6@%#!&35*@#%6@%#!&64*@#%6@%#!&64*@#%6@%#!&52*@#%6@%#!&55*@#%6@%#!&38*@#%6@%#!&38*@#%6@%#!&35*@#%6@%#!&35
@sertdfyguhi
sertdfyguhi / ascii.spwn
Last active June 26, 2021 03:28
Ascii code convert in SPWN.
// only works when run using spwn compiled from source
ascii_table = ['AA==', 'AQ==', 'Ag==', 'Aw==', 'BA==', 'BQ==', 'Bg==', 'Bw==', 'CA==', 'CQ==', 'Cg==', 'Cw==', 'DA==', 'DQ==', 'Dg==', 'Dw==', 'EA==', 'EQ==', 'Eg==', 'Ew==', 'FA==', 'FQ==', 'Fg==', 'Fw==', 'GA==', 'GQ==', 'Gg==', 'Gw==', 'HA==', 'HQ==', 'Hg==', 'Hw==', 'IA==', 'IQ==', 'Ig==', 'Iw==', 'JA==', 'JQ==', 'Jg==', 'Jw==', 'KA==', 'KQ==', 'Kg==', 'Kw==', 'LA==', 'LQ==', 'Lg==', 'Lw==', 'MA==', 'MQ==', 'Mg==', 'Mw==', 'NA==', 'NQ==', 'Ng==', 'Nw==', 'OA==', 'OQ==', 'Og==', 'Ow==', 'PA==', 'PQ==', 'Pg==', 'Pw==', 'QA==', 'QQ==', 'Qg==', 'Qw==', 'RA==', 'RQ==', 'Rg==', 'Rw==', 'SA==', 'SQ==', 'Sg==', 'Sw==', 'TA==', 'TQ==', 'Tg==', 'Tw==', 'UA==', 'UQ==', 'Ug==', 'Uw==', 'VA==', 'VQ==', 'Vg==', 'Vw==', 'WA==', 'WQ==', 'Wg==', 'Ww==', 'XA==', 'XQ==', 'Xg==', 'Xw==', 'YA==', 'YQ==', 'Yg==', 'Yw==', 'ZA==', 'ZQ==', 'Zg==', 'Zw==', 'aA==', 'aQ==', 'ag==', 'aw==', 'bA==', 'bQ==', 'bg==', 'bw==', 'cA==', 'cQ==', 'cg==', 'cw==', 'dA==', 'dQ==', 'dg==', 'd
@sertdfyguhi
sertdfyguhi / binary.spwn
Last active April 21, 2023 16:56
Convert decimal or string to binary in SPWN.
ascii_table = ['AA==', 'AQ==', 'Ag==', 'Aw==', 'BA==', 'BQ==', 'Bg==', 'Bw==', 'CA==', 'CQ==', 'Cg==', 'Cw==', 'DA==', 'DQ==', 'Dg==', 'Dw==', 'EA==', 'EQ==', 'Eg==', 'Ew==', 'FA==', 'FQ==', 'Fg==', 'Fw==', 'GA==', 'GQ==', 'Gg==', 'Gw==', 'HA==', 'HQ==', 'Hg==', 'Hw==', 'IA==', 'IQ==', 'Ig==', 'Iw==', 'JA==', 'JQ==', 'Jg==', 'Jw==', 'KA==', 'KQ==', 'Kg==', 'Kw==', 'LA==', 'LQ==', 'Lg==', 'Lw==', 'MA==', 'MQ==', 'Mg==', 'Mw==', 'NA==', 'NQ==', 'Ng==', 'Nw==', 'OA==', 'OQ==', 'Og==', 'Ow==', 'PA==', 'PQ==', 'Pg==', 'Pw==', 'QA==', 'QQ==', 'Qg==', 'Qw==', 'RA==', 'RQ==', 'Rg==', 'Rw==', 'SA==', 'SQ==', 'Sg==', 'Sw==', 'TA==', 'TQ==', 'Tg==', 'Tw==', 'UA==', 'UQ==', 'Ug==', 'Uw==', 'VA==', 'VQ==', 'Vg==', 'Vw==', 'WA==', 'WQ==', 'Wg==', 'Ww==', 'XA==', 'XQ==', 'Xg==', 'Xw==', 'YA==', 'YQ==', 'Yg==', 'Yw==', 'ZA==', 'ZQ==', 'Zg==', 'Zw==', 'aA==', 'aQ==', 'ag==', 'aw==', 'bA==', 'bQ==', 'bg==', 'bw==', 'cA==', 'cQ==', 'cg==', 'cw==', 'dA==', 'dQ==', 'dg==', 'dw==', 'eA==', 'eQ==', 'eg==', 'ew==', 'fA==', 'fQ==', '