Skip to content

Instantly share code, notes, and snippets.

View ulcuber's full-sized avatar

Victor S. ulcuber

  • FrameWorkTeam
  • GMT+4
View GitHub Profile
modid count
mcp 18574
FML 18574
minecraft 15632
forge 15632
jei 12846
forgelin 11616
chisel 11237
baubles 11101
crafttweakerjei 10589
@yyogo
yyogo / spliterr.sh
Last active January 23, 2024 10:37
Split stderr from comand to separate tmux pane
#!/bin/bash
set -m
showhelp() {
echo "Usage: $0 [-ohvrc] <command>"
echo "Pipes stderr from command to a new tmux pane."
echo " -h | -v split horizontally or vertically (default vertically)"
echo " -r send stdout to pane instead of stderr"
echo " -o send both stdout and stderr to new panes"
echo " -c close pane automatically after program terminates"
@mareq
mareq / ale_coc.vim
Created April 12, 2021 01:14
CoC & ALE vim configuration
" ALE (#NA; https://vimawesome.com/plugin/ale)
"
" CoC is used as the default choice in this ALE-CoC-mixed configuration. ALE is used only as a fallback for running
" scripts which CoC can not run. In order to make the behaviour uniform, regardless of how the linters are being run,
" this configuration makes CoC send its code-diagnostics to ALE and ALE is used to display them.
" GENERAL BEHAVIOUR
" Disable LSP features in ALE (offloaded to CoC)
" https://github.com/dense-analysis/ale#5iii-how-can-i-use-ale-and-cocnvim-together
" with :CocConfig and add `"diagnostic.displayByAle": true`
@kesyog
kesyog / i3 multiple monitors.md
Last active December 1, 2023 12:54
Configuring multiple displays with i3

Configuring multiple displays with i3

Motivation

I've run into a few common issues running i3 on a laptop with external monitors.

  • When running i3, external monitors aren't always detected properly.
  • When running multiple displays with different resolutions, text scaling is inconsistent.
  • I'd like to be able to automatically change configurations if I unplug my external monitor(s), plug in a projector, etc.
@3v1n0
3v1n0 / vscode-unused-workspace-storage-cleanup.sh
Last active December 25, 2024 13:53
VSCode unused workspaceStorage cleanup
#!/bin/bash
CONFIG_PATH=~/.config/Code
for i in $CONFIG_PATH/User/workspaceStorage/*; do
if [ -f $i/workspace.json ]; then
folder="$(python3 -c "import sys, json; print(json.load(open(sys.argv[1], 'r'))['folder'])" $i/workspace.json 2>/dev/null | sed 's#^file://##;s/+/ /g;s/%\(..\)/\\x\1/g;')"
if [ -n "$folder" ] && [ ! -d "$folder" ]; then
echo "Removing workspace $(basename $i) for deleted folder $folder of size $(du -sh $i|cut -f1)"
const PNG = require('pngjs-image')
const colors = [
{ red: 0, green: 0, blue: 0, alpha: 0 },
{ red: 89, green: 125, blue: 39, alpha: 255 },
{ red: 109, green: 153, blue: 48, alpha: 255 },
{ red: 127, green: 178, blue: 56, alpha: 255 },
{ red: 67, green: 94, blue: 29, alpha: 255 },
{ red: 174, green: 164, blue: 115, alpha: 255 },
{ red: 213, green: 201, blue: 140, alpha: 255 },
{ red: 247, green: 233, blue: 163, alpha: 255 },
@lluiscab
lluiscab / map.js
Last active September 5, 2024 22:58
Mineflayer map
const mineflayer = require('mineflayer')
const PNGImage = require('pngjs-image');
if (process.argv.length < 4 || process.argv.length > 6) {
console.log('Usage : node echo.js <host> <port> [<name>] [<password>]')
process.exit(1)
}
const bot = mineflayer.createBot({
@loilo
loilo / pass-slots.md
Last active October 16, 2024 18:16
Vue: Pass Slots through from Parent to Child Components

Vue: Pass Slots through from Parent to Child Components

The Situation

  • We've got some components A, B and C which provide different slots.
    const A = {
      template: `<div><slot name="a">Default A Content</slot></div>`
    }

const B = {

@gaearon
gaearon / minification.md
Last active October 15, 2024 07:39
How to Set Up Minification

In production, it is recommended to minify any JavaScript code that is included with your application. Minification can help your website load several times faster, especially as the size of your JavaScript source code grows.

Here's one way to set it up:

  1. Install Node.js
  2. Run npm init -y in your project folder (don't skip this step!)
  3. Run npm install terser

Now, to minify a file called like_button.js, run in the terminal:

@GNSPS
GNSPS / ProxyFactory.sol
Last active December 11, 2024 21:58
Improved `delegatecall` proxy contract factory (Solidity) [v0.0.5]
/***
* Shoutouts:
*
* Bytecode origin https://www.reddit.com/r/ethereum/comments/6ic49q/any_assembly_programmers_willing_to_write_a/dj5ceuw/
* Modified version of Vitalik's https://www.reddit.com/r/ethereum/comments/6c1jui/delegatecall_forwarders_how_to_save_5098_on/
* Credits to Jorge Izquierdo (@izqui) for coming up with this design here: https://gist.github.com/izqui/7f904443e6d19c1ab52ec7f5ad46b3a8
* Credits to Stefan George (@Georgi87) for inspiration for many of the improvements from Gnosis Safe: https://github.com/gnosis/gnosis-safe-contracts
*
* This version has many improvements over the original @izqui's library like using REVERT instead of THROWing on failed calls.
* It also implements the awesome design pattern for initializing code as seen in Gnosis Safe Factory: https://github.com/gnosis/gnosis-safe-contracts/blob/master/contracts/ProxyFactory.sol