Skip to content

Instantly share code, notes, and snippets.

View codemasher's full-sized avatar
🏳️‍🌈

smiley codemasher

🏳️‍🌈
View GitHub Profile
/* ==UserStyle==
@name github-tweaks
@namespace github.com/codemasher/github-tweaks
@version 2.0.0
@description Tweaks for the "new" GitHub style 06/2020, update 06/2023, update 02/2024
@author codemasher
@license MIT
@link https://gist.github.com/codemasher/e4fea480849e0f984b7fb2accd759e95
==/UserStyle== */
@codemasher
codemasher / genshin-wish-history.php
Created July 5, 2023 21:12
get genshin gacha log url from cache
<?php
/**
* genshin-wish-history.php
*
* @see https://gist.github.com/MadeBaruna/1d75c1d37d19eca71591ec8a31178235
* @see https://github.com/chillerlan/php-httpinterface
*
* @created 05.07.2023
* @author smiley <smiley@chillerlan.net>
* @copyright 2023 smiley
@codemasher
codemasher / gb2312-table.php
Created January 30, 2023 20:37
Create a table of GB2312/Hanzi in PHP
<?php
/**
* gb2312-table.php
*
* @see https://en.wikipedia.org/wiki/GB_2312
* @see http://www.herongyang.com/GB2312/Introduction-of-GB2312.html
* @see https://en.wikipedia.org/wiki/GBK_(character_encoding)#Encoding
*
* @created 30.01.2023
* @author smiley <smiley@chillerlan.net>
@codemasher
codemasher / sjis-table.php
Last active January 30, 2023 13:29
Create a table of Shift-JIS Kanji in PHP
<?php
/**
* sjis-table.php
*
* QR Code ISO/IEC 18004:2000 - 8.4.5 Kanji Mode
*
* @see https://en.wikipedia.org/wiki/Shift_JIS#With_vendor_or_JIS_X_0213_extensions
* @see http://www.rikai.com/library/kanjitables/kanji_codes.sjis.shtml
*
* @created 29.01.2023
@codemasher
codemasher / timeline.php
Last active December 14, 2022 16:49
Fetch your twitter timeline via the unofficial adaptive search API
<?php
/**
* Twitter timeline backup
*
* Required:
* - PHP 8.1+
* - cURL extension enabled
* - Windows:
* - download https://windows.php.net/downloads/releases/php-8.1.12-Win32-vs16-x64.zip (or a newer available version)
* - unzip to a folder of your choice
This file has been truncated, but you can view the full file.
{
"1594486665971892224": {
"id": 1594486665971892224,
"user_id": 16298441,
"user": null,
"created_at": 1668990219,
"text": "if you tell me The Mask is standing behind me i will turn around and try to look at it. Because my dumb ass thinks The Mask is real",
"source": "<a href=\"https://mobile.twitter.com\" rel=\"nofollow\">Twitter Web App</a>",
"retweet_count": 670,
"favorite_count": 7772,
<?php
/**
* parse-dril-csv.php
*
* @see https://docs.google.com/spreadsheets/d/1juZ8Dzx-hVCDx_JLVOKI1eHzBlURHd7u6dqkb3F8q4w (every wint (@dril) tweet)
* @see https://gist.github.com/codemasher/d921cab21c3e684e6bb69219da900b4e (dril's entire timeline, fetched via the unofficial search API)
* @see https://gist.github.com/codemasher/67ba24cee88029a3278c87ff9a0095ba (Fetch your twitter timeline via the unofficial adaptive search API)
*
* @created 20.11.2022
* @author smiley <smiley@chillerlan.net>
@codemasher
codemasher / pathfinder-poc.php
Created February 2, 2022 20:12
Spotify artist/album metadata via web client API proof of concept. https://twitter.com/Screamales/status/1488891097384468480
<?php
/**
* Fetch artist/album metadata from the "inofficial" Spotify web client API
* no Spotify account or developer access required
*
* @created 02.02.2022
* @copyright 2022 smiley <@codemasher>
* @license WTFPL
*/
@codemasher
codemasher / lyrics-poc.php
Created September 22, 2022 16:24
Spotify lyrics API fetch proof of concept
<?php
/**
* spotify lyrics proof-of-concept
*
* @created 22.09.2022
* @author smiley <smiley@chillerlan.net>
* @copyright 2022 smiley
* @license MIT
*/
<?php
/**
* This code generates an SVG QR code with rounded corners. It uses a round rect for each square and then additional
* paths to fill in the gap where squares are next to each other. Adjacent squares overlap - to almost completely
* eliminate hairline antialias "cracks" that tend to appear when two SVG paths are exactly adjacent to each other.
*
* composer require chillerlan/php-qrcode (tested with version v5 dev-main)
*/