Skip to content

Instantly share code, notes, and snippets.

View neoascetic's full-sized avatar
🏠
Working from home

Pavel neoascetic

🏠
Working from home
View GitHub Profile
@neoascetic
neoascetic / test.html
Created February 21, 2022 17:09
raw.githack.com test
raw.githack.com is working!
@neoascetic
neoascetic / patrons.py
Created January 29, 2023 07:41
Get patron emails from Patreon
import json
import requests
API_TOKEN = 'XXX'
CAMPAIGN_ID = 'XXX'
def get_page(url, headers):
result = requests.get(url, headers=headers)
@neoascetic
neoascetic / teapot.svg
Last active February 1, 2024 19:51
Utah teapot as SVG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@neoascetic
neoascetic / multiline.bash
Created February 28, 2024 10:15
Neat way to define multiline variables in bash
#!/bin/bash
multiline() {
read -r -d '' "$@"
}
multiline text << 'END'
Hello, world!
Multiline docstrings seems to work today...
@neoascetic
neoascetic / Noise.cs
Created April 1, 2024 15:58
Simple Unity script to preview various Perlin noise settings
using UnityEngine;
using Unity.Mathematics;
public class Noise : MonoBehaviour {
public int width;
public int height;
public float scaleX;
public float scaleY;
public float offsetX;
@neoascetic
neoascetic / markdown
Created June 7, 2024 14:04
GitHub Flavored Markdown render script
#!/usr/bin/env ruby
require 'redcarpet'
class HTMLWithPants < Redcarpet::Render::HTML
include Redcarpet::Render::SmartyPants
end
markdown = Redcarpet::Markdown.new(HTMLWithPants, fenced_code_blocks: true)
puts markdown.render STDIN.read
@neoascetic
neoascetic / .zshrc
Last active February 6, 2025 10:39
You don't need a zsh framework. You need just plug!
# usage: plug! some/repo[:branch] [file-to.load ...]
# example: plug! sindresorhus/pure:main async.zsh pure.zsh
# to update everything - simply remove ~/.plug directory
function plug!() {
local arg=("${(@s/:/)1}") && r=$arg[1] && b=${arg[2]:=master}
local dir="$HOME/.plug/$r"
[[ -d $dir ]] || git clone --depth=1 --branch=$b https://github.com/$r $dir
for f in "${@:2}"; do source "$dir/$f"; done
}