Skip to content

Instantly share code, notes, and snippets.

View blurymind's full-sized avatar

Todor Imreorov blurymind

View GitHub Profile
@blurymind
blurymind / copyTorrentFileMagnetToClipboard.sh
Last active June 9, 2022 18:27
copyTorrentFileMagnetToClipboard.sh
#!/bin/sh
file="$1"
transmission-show -m "$file" | xclip -sel clip
zenity --notification --text "Magnet link copied to clipboard!"
# If you open a torrent file with this script, the file's magnet link will be extracted and copied to the clipboard
# this script requires transmission-cli and zenity to be installed
# todo: also send to synology somehow
@blurymind
blurymind / about.txt
Created August 23, 2021 12:04
GB tilesets
set: test.png
author: yaya
source: googl.com
license: CC2
---
set: test.png
author: yaya
source: googl.com
license: CC2
---
@blurymind
blurymind / README.md
Created May 1, 2021 19:57 — forked from joyrexus/README.md
Load encoded thumbnail from a gist

Quick demo showing how to get a Base64-encoded thumbnail.png file from a gist.


Thumbnails are very handy visual indicators of the content of a block on bl.ocks.org, esp for rapidly surveying a user's collection.

However, many block creators don't add thumbnails because of the extra steps involved in adding them to a gist. Since the gist API doesn't let you upload binaries you end up having to clone you're gist to add a thumbnail. Note: @mbostock's gist to clone all gists is useful here.

It's been suggested that the gist-img shell script enables you to upload thumbnail images. That's at least half true. It automates the base64 encoding of png images prior to upload with @defunkt's gist CLI tool, so you end up u

xsetwacom --set "Wacom BambooFun 6x8 Pad pad" Button 1 "key space"
@blurymind
blurymind / cleanupArchCache.sh
Last active June 9, 2022 18:37
Free space on Arch linux/manjaro
#!/bin/bash
pacman -Scc
pacman -Qdt
pacman -Rns $(pacman -Qtdq)
journalctl --vacuum-size=50M
# Clean yay cache
yay -Sc -a
#report lost
@blurymind
blurymind / global.js
Last active November 1, 2020 16:27
Ags reusable methods
//// This is ags script, not javascript - C like, but not quite
//////////// walk to and pick //////////////////
/// https://adventuregamestudio.github.io/ags-manual/Object.html
function walkToAndPick(this Object*, InventoryItem* addObject ,const string say){
player.Walk(this.X, this.Y, eBlock, eWalkableAreas);
String toSay = "";
if (String.Format("%d",say) =="0") {
toSay = String.Format("Found a %s", addObject.Name);
}
else {
@blurymind
blurymind / Revert-Gist.md
Created July 18, 2020 09:23 — forked from eduncan911/Revert-Gist.md
Revert Gist Commits

Revert / Undo a Gist Commit

It was not exactly obvious. Here's how to revert a Gist commit!

Checkout the gist like a normal git repo:

# replace the Gist ID with your own
git clone git@github.com:cc13e0fcf2c348cc126f918e4a3917eb.git

Treat it like a normal repo. Edit, force push, etc.

@blurymind
blurymind / service-worker.js
Created June 28, 2020 17:21 — forked from jeffposnick/service-worker.js
Example of InjectManifest in Workbox v5
// Add any other logic here as needed.
import { CacheableResponsePlugin } from 'workbox-cacheable-response/CacheableResponsePlugin';
import { CacheFirst } from 'workbox-strategies/CacheFirst';
import { createHandlerForURL } from 'workbox-precaching/createHandlerForURL';
import { ExpirationPlugin } from 'workbox-expiration/ExpirationPlugin';
import { NavigationRoute } from 'workbox-routing/NavigationRoute';
import { precacheAndRoute } from 'workbox-precaching/precacheAndRoute';
import { registerRoute } from 'workbox-routing/registerRoute';
prepareAnimationStrip(frames) {
let renderer = this.app.renderer;
const rect = new PIXI.Rectangle(
0,
0,
this.tilewidth * frames.length,
this.tileheight
);
var container = new PIXI.Container();
export const getBottomChildren = (scanObject: any, limit: number | null = null, collectedChildren: Array<any> = []) => {
if (limit && collectedChildren.length === limit) return collectedChildren;
if (scanObject.children === null) collectedChildren.push(scanObject);
else scanObject.children.forEach(child => getBottomChildren(child, limit, collectedChildren));
return collectedChildren;
};
export const collectChildrenWithKey = (