Skip to content

Instantly share code, notes, and snippets.

View patrick330602's full-sized avatar

Patrick Wu patrick330602

View GitHub Profile
@shakna-israel
shakna-israel / LetsDestroyC.md
Created January 30, 2020 03:50
Let's Destroy C

Let's Destroy C

I have a pet project I work on, every now and then. CNoEvil.

The concept is simple enough.

What if, for a moment, we forgot all the rules we know. That we ignore every good idea, and accept all the terrible ones. That nothing is off limits. Can we turn C into a new language? Can we do what Lisp and Forth let the over-eager programmer do, but in C?


@cerebrate
cerebrate / README.md
Last active December 2, 2023 08:17
Recompile your WSL2 kernel - support for snaps, apparmor, lxc, etc.

WARNING

THIS GIST IS EXTREMELY OBSOLETE. DO NOT FOLLOW THESE INSTRUCTIONS. SERIOUSLY.

IF YOU IGNORE THE ABOVE WARNING, YOU AGREE IN ADVANCE THAT YOU DIDN'T GET THESE INSTRUCTIONS FROM ME, THAT I WARNED YOU, AND THAT I RESERVE THE RIGHT TO POINT AND LAUGH MOCKINGLY IF AND WHEN SOMETHING BREAKS HORRIBLY.

I'll do a write-up of current custom-kernel procedures over on Random Bytes ( https://randombytes.substack.com/ ) one day soon.

NOTE

@sainnhe
sainnhe / lightline-and-tmux-config.md
Last active October 26, 2022 23:52
Sexy & Powerful Configuration for Lightline and Tmux

𝑺𝒆𝒙𝒚 & 𝑷𝒐𝒘𝒆𝒓𝒇𝒖𝒍 𝑪𝒐𝒏𝒇𝒊𝒈𝒖𝒓𝒂𝒕𝒊𝒐𝒏 𝒇𝒐𝒓 𝑳𝒊𝒈𝒉𝒕𝒍𝒊𝒏𝒆 𝒂𝒏𝒅 𝑻𝒎𝒖𝒙

Nerd Font

First of all, install a nerd font, and apply it: nerd font

# Simple and stupid script that locks the computer and starts filming using the webcam if the mouse coursor moves
# Requires ffmpeg to be installed
[System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
function mousecheck {
while($true)
{
Start-Sleep -m 500 #added delay
$mouseY = ([System.Windows.Forms.Cursor]::Position.Y ) #read the Y coordinates
@matthiassb
matthiassb / dns-sync.sh
Last active March 20, 2024 12:12
Init.d script for keeping WSL resolv.conf in-sync with Windows
#! /bin/bash
### BEGIN INIT INFO
# Provides: dns-sync
# Required-Start:
# Required-Stop:
# Default-Start: S
# Default-Stop:
# Short-Description: Synchronizes /etc/resolv.conf in WLS with Windows DNS - Matthias Brooks
### END INIT INFO
@anthonyeden
anthonyeden / FontInstallation.ps1
Last active April 11, 2024 03:35
Font User Installation - Powershell (No Admin Password Needed)
# Run this as a Computer Startup script to allow installing fonts from C:\InstallFont\
# Based on http://www.edugeek.net/forums/windows-7/123187-installation-fonts-without-admin-rights-2.html
# Run this as a Computer Startup Script in Group Policy
# Full details on my website - https://mediarealm.com.au/articles/windows-font-install-no-password-powershell/
$SourceDir = "C:\InstallFont\"
$Source = "C:\InstallFont\*"
$Destination = (New-Object -ComObject Shell.Application).Namespace(0x14)
$TempFolder = "C:\Windows\Temp\Fonts"
@steinwaywhw
steinwaywhw / One Liner to Download the Latest Release from Github Repo.md
Last active May 3, 2024 15:54
One Liner to Download the Latest Release from Github Repo
  • Use curl to get the JSON response for the latest release
  • Use grep to find the line containing file URL
  • Use cut and tr to extract the URL
  • Use wget to download it
curl -s https://api.github.com/repos/jgm/pandoc/releases/latest \
| grep "browser_download_url.*deb" \
| cut -d : -f 2,3 \
| tr -d \" \