Skip to content

Instantly share code, notes, and snippets.

View y-ack's full-sized avatar
♻️
brain damage per second

ywy y-ack

♻️
brain damage per second
View GitHub Profile
@y-ack
y-ack / monster_names.asm
Last active February 21, 2017 21:06
replaced names
MonsterNames:
db "RHYDON@@@@"
db "KANGASKHAN"
db "NIDORAN♂@@"
db "CLEFAIRY@@"
db "SPEAROW@@@"
db "VOLTORB@@@"
db "NIDOKING@@"
db "SLOWBRO@@@"
db "IVYSAUR@@@"
@y-ack
y-ack / PokemonRedMapTools.ps1
Created March 19, 2017 21:40
Now I can edit map data in a text editor
#Use examples:
#Get-Content route1.blk | MapBytesToText -Width 10
#(Invoke-WebRequest https://raw.githubusercontent.com/pret/pokeyellow/master/maps/route1.blk).Content | MapBytesToText -Width 10
#Takes .blk files and outputs a table of tile block indexes I can actually work with
#The resulting format can be eaten by MapBytesToText to convert back into .blk
function MapBytesToText {
param([Parameter(Mandatory=$True,Position=1,ValueFromPipeline=$True)][String]$File,
[Parameter(Mandatory=$False)][Int]$Width)
$Width = $Width*4
@y-ack
y-ack / layoutguides.js
Last active August 30, 2017 02:56
Adds rule of thirds and golden ratio guides to page innerHTML
var guidesRawHTML = `<style>
@media all and (orientation:portrait) {
.goldenratio {
transform: rotate(90deg);
transform-origin: 38% 60%;
width: calc(100vh + .5rem);
}
}
.layoutguide {
position: fixed;
@y-ack
y-ack / KlandScreenshot.ps1
Last active November 7, 2017 02:26
upload screenshots with powershell
function Upload-ToKland {
param([String]$bucket = "",
[String]$Image,
[String]$Url = "https://kland.smilebasicsource.com/uploadimage")
$ImageName = [regex]::Match($Image,"[^\\/]+\.(png|PNG|gif|GIF|jpe?g|JPE?G)").Value
$Image = [System.Text.Encoding]::GetEncoding("iso-8859-1").GetString([IO.File]::ReadAllBytes($Image))
$ImageType = [System.Web.MimeMapping]::GetMimeMapping($Image)
$boundary = [guid]::NewGuid().ToString()
@y-ack
y-ack / AnalyzeLogs.ps1
Created November 10, 2017 05:12
SmileBASIC Source Log Graphing (files will be released slowly)
[Uri]$Domain = "http://scratch.smilebasicsource.com/chatlogs"
[Microsoft.PowerShell.Commands.HtmlWebResponseObject]$LogListDocument = Invoke-WebRequest $Domain
[Int32]$CurrentFileNum = 0
[Int32]$TotalFiles = $LogListDocument.Links.Count
[Regex]$DateRegexp = [Regex]'(\d\d-\d\d-\d\d)'
[Regex]$UserRegexp = [Regex]'\n *([a-zA-Z0-9_]+)\['
[String]$TAB = "`t"
[String]$UserData = "" # only users logged for each day
@y-ack
y-ack / Untitled.ps1
Created November 10, 2017 02:46
Very dirty script used to generate JSON archives of miiverse
#$MiiverseList = Invoke-RestMethod "https://pastebin.com/raw/4kxfQWSH"
#$MiiverseList = $MiiverseList -split "`r`n"
$MiiverseList = dir .\chat_links | ? name -match "^AY" | select name
#$MiiverseList = @("https://miiverse.nintendo.net/replies/AYMHAAADAAB2V0e0LQKOBA")
#$SaveDirectory = "$home/miiverse"
$SaveDirectory = "$home/snail_miiverse"
mkdir $SaveDirectory
mkdir "$SaveDirectory/images/"
@y-ack
y-ack / collapsingtoc.css
Last active November 14, 2017 19:01
org stuff
#toggle-table-of-contents {
display: none;
}
#toggle-table-of-contents ~ label {
text-decoration: underline;
}
#toggle-table-of-contents ~ label::before {
content: "hide ";
@y-ack
y-ack / START.PRG
Created February 9, 2018 01:07
smilebasic joke hello world "A Game About Anime"
CLS
DIM CONSHEIGHT%:CONSHEIGHT% = 30
DIM TITLE$,START$:TITLE$ = "a game about anime":START$ = "PRESS START"
GOSUB @INITTIMERS
TITLEPRINT TITLE$, 0, 0
EAT CREATETIMER("TEXTON", 40)
EAT CREATETIMER("TEXTOFF", 80)
@y-ack
y-ack / 2018-04-11.ps1
Created April 14, 2018 18:22
script everyday
#PowerShell: convert strings copied as integers back to byte-characters
function convertchars([uint32]$a){return [bitconverter]::GetBytes([uint32]$a) | %{[char]$_}}
code (hex)instruction
36CHKLABEL
37CHKCALL
38CHKVAR
39???
3A???
3B???
3CPOP
3DSHIFT