Skip to content

Instantly share code, notes, and snippets.

View sgtrusty's full-sized avatar
💭
happy im heeeere

Santiago González sgtrusty

💭
happy im heeeere
View GitHub Profile
@sgtrusty
sgtrusty / _no_code_page_.php
Created January 23, 2023 00:49 — forked from Dan-Q/_no_code_page_.php
Hacky PHP to produce a "blank" web page which somehow has content when viewed in Firefox. Sample page at https://danq.me/wp-content/no-code-webpage/, explanation at https://danq.me/nocode
<?php
// half-hearted CSS minification
$css = preg_replace(
array('/\s*(\w)\s*{\s*/','/\s*(\S*:)(\s*)([^;]*)(\s|\n)*;(\n|\s)*/','/\n/','/\s*}\s*/'),
array('$1{ ','$1$3;',"",'} '),
file_get_contents('linked.css')
);
// embed as a data: uri
$base64css = rtrim(strtr(base64_encode($css), '+/', '-_'), '=');
@sgtrusty
sgtrusty / ConditionalBindings.hs
Created October 4, 2022 01:27 — forked from LSLeary/ConditionalBindings.hs
Conditional key bindings for xmonad. WIP.
{-# LANGUAGE StandaloneDeriving, DeriveFunctor, GeneralizedNewtypeDeriving #-}
{-# LANGUAGE LambdaCase #-}
--------------------------------------------------------------------------------
-- Module : XMonad.Actions.ConditionalBindings
-- Description : A framework for producing conditional key bindings.
-- Copyright : (c) 2018 L. S. Leary
-- License : BSD3-style (see LICENSE)
--
-- Maintainer : L. S. Leary
@sgtrusty
sgtrusty / README.txt
Created August 25, 2022 17:53 — forked from CSaratakij/README.txt
Video Wallpaper (hw-accelerate) : Use 'mpv' as a video player backend with 'xwinwrap' to wrap our window to be use as a desktop background
You want to use a live wallpaper in x11?
Great!!...but It come as a cost.
I did experiment with .gif backend and non hardware accelerate backend, It sucks.
CPU usage was so high (40% up just for idle), unacceptable for my laptop.
Running with those backend for such a really long time will slowly turn your laptop into the hot potato.
But don't be upset, we can reduce those cost.
Using the video player with hardware video decoding support can reduce the cost.
@sgtrusty
sgtrusty / Install i3 on arch.sh
Created August 9, 2022 15:23 — forked from chreniuc/Install i3 on arch.sh
Steps i followed to install arch + i3
timedatectl set-ntp true
timedatectl set-timezone Europe/Bucharest
fdisk /dev/sda
########################################
n 1G pentru /boot /dev/sda1
a - Flag it as bootable
n - 4G pentru swap /dev/sda3
n - 70G pentru / /dev/sda2
@sgtrusty
sgtrusty / arch-i3gaps-install.md
Created August 9, 2022 15:23 — forked from fjpalacios/arch-i3gaps-install.md
Arch + i3-gaps Install Guide

Arch + i3-gaps Install Guide

First set up your keyboard layout. For example, in Spanish:

   # loadkeys es

For a list of all acceptable keymaps:

   # localectl list-keymaps
@sgtrusty
sgtrusty / arch-i3gaps-install.md
Created August 6, 2022 00:54 — forked from m4jrt0m/arch-i3gaps-install.md
Arch + i3-gaps Install Guide

Arch + i3-gaps Install Guide

First set up your keyboard layout. For example, in Spanish:

   # loadkeys es

For a list of all acceptable keymaps:

   # localectl list-keymaps
@sgtrusty
sgtrusty / 1_VsVimCookbook.md
Created October 2, 2020 04:11 — forked from dogfuntom/Vim Ideas.md
VsVim Registers and Marks Cheat Sheet #vs #vim #vsvim

Workarounds

Filling empty line between { and }

When you type a new method, VS aids you and you end up with this:

private void Foo()
{

}
@sgtrusty
sgtrusty / rain.cpp
Created July 30, 2020 00:36 — forked from thaenor/rain.cpp
openGL particle rain snow and hail effects
// May Ang
// [email protected]
// CS 161 - Animation & Visualization
// Final Project - Rain/Hail/Snow Simulation
//source: https://classes.soe.ucsc.edu/cmps161/Winter09/projects/mang/finalproject.html
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
import operator
# Estas cedulas fueron emitidas por la JCE, pero no cumplen con el
# digito verificador, por lo cual deben ser verificadas por separado.
excepcionesCedulas = ['00000000018', '11111111123', '00100759932', '00105606543', '00114272360', '00200123640',
'00200409772', '00800106971', '01200004166', '01400074875', '01400000282', '03103749672',
'03200066940', '03800032522', '03900192284', '04900026260', '05900072869', '07700009346',
'00114532330', '03121982479', '40200700675', '40200639953', '00121581750', '00119161853',
'22321581834', '00121581800', '09421581768', '22721581818', '90001200901', '00301200901',
'40200452735', '40200401324', '10621581792'];
@sgtrusty
sgtrusty / Efficient Encrypted UEFI-Booting Arch Installation
Created May 22, 2020 02:41 — forked from HardenedArray/Efficient Encrypted UEFI-Booting Arch Installation
An effcient method to install Arch Linux with encrypted root and swap filesystems and boot from UEFI. Multi-OS, and VirtualBox, UEFI-booting are also supported.
# OBJECTIVE: Install Arch Linux with encrypted root and swap filesystems and boot from UEFI.
# Note this encrypted installation method, while perfectly correct and highly secure, CANNOT support encrypted /boot and
# also CANNOT be subsequently converted to support an encrypted /boot!!! A CLEAN INSTALL will be required!
# Therefore, if you want to have an encrypted /boot or will want an encrypted /boot system at some point in the future,
# please ONLY follow my encrypted /boot installation guide, which lives here: