Skip to content

Instantly share code, notes, and snippets.

View sebastienvermeille's full-sized avatar
🦇

Sebastien Vermeille sebastienvermeille

🦇
View GitHub Profile
@sam-yam
sam-yam / Singleton.cs
Created March 18, 2023 05:14
Networked Singleton - Unity Netcode
using Unity.Netcode;
using UnityEngine;
/*
Generic classes for the use of singleton
there are 3 types:
- MonoBehaviour -> for the use of singleton to normal MonoBehaviours
- NetworkBehaviour -> for the use of singleton that uses the NetworkBehaviours
- Persistent -> when we need to make sure the object is not destroyed during the session
*/
@curioswati
curioswati / flatpak-dmenu.md
Last active July 15, 2024 18:43
To run flatpak installed apps from dmenu.

To run a flatpak app from dmenu, you can create a symlink for the app in /usr/bin. You can find the flatpak apps binary link in /var/lib/flatpak/exports/bin/ on ubuntu. E.g. to run Rocket Chat (installed from flatpak via software center), you can do something like this:

sudo ln -s /var/lib/flatpak/exports/bin/chat.rocket.RocketChat /usr/bin/rocket-chat

This way you will be able to find it in the dmenu.

Resources:

@YJPL
YJPL / img_tag_tansform.rb
Last active October 14, 2022 17:03
Jekyll plugin to replace Markdown images e.g. `![alt description](image.jpg)` with `{% picture %}`. This tag works for collections in addition to posts. Written to work combined with Jekyll Picture Tag. The link opens the original image.
# Description: Jekyll plugin to replace Markdown image syntax with HTML markup, written to work combined with Jekyll Picture Tag
Jekyll::Hooks.register :documents, :pre_render do |document, payload|
docExt = document.extname.tr('.', '')
# only process if we deal with a markdown file
if payload['site']['markdown_ext'].include? docExt
newContent = document.content.gsub(/!\[(.*)\]\(([^\)]+)\)(?:{:([^}]+)})*/, '{% picture default \2 --alt \1 --link /img/\2 %}')
document.content = newContent
end
end
@sverhoeven
sverhoeven / requirements.txt
Created March 28, 2017 14:50
List webhooks of all repos in a GitHub organization
github3.py==1.0.0a4
click==6.7
@brock
brock / psql-with-gzip-cheatsheet.sh
Last active June 27, 2024 10:09
Exporting and Importing Postgres Databases using gzip
# This is just a cheat sheet:
# On production
sudo -u postgres pg_dump database | gzip -9 > database.sql.gz
# On local
scp -C production:~/database.sql.gz
dropdb database && createdb database
gunzip < database.sql.gz | psql database