Skip to content

Instantly share code, notes, and snippets.

View blurymind's full-sized avatar

Todor Imreorov blurymind

View GitHub Profile
@blurymind
blurymind / Deck ui.md
Created January 11, 2024 16:11 — forked from red-dragon65/Deck ui.md
How to properly run Steam Decks UI on Manjaro

This guide is deprecated! Please take a look at the defacto un-official SteamOS project HoloISO.

HoloISO is more straightforward to install and is being actively worked on.


Running Steams Deck UI on Manjaro with Minimal Glitches

This is an unofficial short guide on running Steam Decks new UI on Manjaro. I am kind of a linux noob, so forgive me if I get a few things wrong in this guide. Also, I have not fully tested everything so there may be some weird issues that I have overlooked.

@blurymind
blurymind / script.js
Created April 18, 2023 17:29 — forked from MichaelPHolstein/script.js
JavaScript file of background removal using Tensorflow and bodyPix
IMAGE_SRC = './img/8.jpg'
const loadImage = () => {
const img = new Image()
img.src = IMAGE_SRC
const canvas = document.querySelector('canvas')
const ctx = canvas.getContext('2d')
img.addEventListener('load', () => {
@blurymind
blurymind / remove-alpha-on-canvas.js
Created December 8, 2022 10:15 — forked from redblobgames/remove-alpha-on-canvas.js
Remove alpha channel on a canvas, so it's always transparent or always opaque
const imageData = ctx.getImageData(0, 0, canvas.width, canvas.height);
const pixels = imageData.data;
for (let i = 3, n = canvas.width * canvas.height * 4; i < n; i += 4) {
pixels[i] = pixels[i] < 127? 0 : 255
}
ctx.putImageData(imageData, 0, 0);
@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

@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';
@blurymind
blurymind / acejs_bbc
Created July 22, 2019 08:00 — forked from gnysek/acejs_bbc
ACE js bbcode
define(function(require, exports, module) {
"use strict";
var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var MyNewHighlightRules = function() {
this.$rules = {
"start" : [
@blurymind
blurymind / threevideodemo.js
Created March 15, 2018 14:26 — forked from ErikPeterson/threevideodemo.js
THREEJS Video Texture Demo
//Set up scene, camera, and renderer
var scene = new THREE.Scene;
var camera = new THREE.PerspectiveCamera( 45, window.innerWidth / window.innerHeight, 1, 10000 );
var renderer = new THREE.CanvasRenderer();
renderer.setClearColor( 0xf0f0f0 );
renderer.setSize( window.innerWidth, window.innerHeight );
document.body.appendChild( renderer.domElement );
var video = document.createElement('video');
@blurymind
blurymind / pan.gd
Last active July 29, 2016 18:58 — forked from neikeq/pan.gd
extends Camera2D
var dragging = false
func _ready():
set_process_input(true)
func _input(event):
if event.type == InputEvent.MOUSE_BUTTON and event.button_index == BUTTON_MIDDLE:
dragging = event.is_pressed()
extends LineEdit
var updating = false
const allowed = ["0","1","2","3","4","5","6","7","8","9"]
func _ready():
connect("text_changed",self,"otc")