Skip to content

Instantly share code, notes, and snippets.

View ttys3's full-sized avatar
💭
sad, ttyS0 has been taken by other user

ttys3

💭
sad, ttyS0 has been taken by other user
View GitHub Profile
@ttys3
ttys3 / pacman.md
Last active September 26, 2021 14:37 — forked from tanyuan/pacman.md
Useful commands for pacman and paru

Arch Linux Pacman & Paru (Feature packed AUR helper)

Pacman (Official)

Easter egg

Edit /etc/pacman.conf:

Under the # Misc options section, remove the # in front of Color and add the line ILoveCandy. Because Pac-Man loves candy.

@ttys3
ttys3 / dockergrep.sh
Created September 22, 2021 18:01 — forked from roylee0704/dockergrep.sh
how to grep docker log
docker logs nginx 2>&1 | grep "127."
# ref: http://stackoverflow.com/questions/34724980/finding-a-string-in-docker-logs-of-container
@ttys3
ttys3 / gist:3fac878dcda16010e4116adc78022a54
Created June 9, 2021 06:29 — forked from Victa/gist:2169221
Force Hardware Acceleration in WebKit with translate3d
/* warp speed ahead */
.animClass {
-webkit-transform: translate3d(0, 0, 0);
/* more specific animation properties here */
}
/*
The use of translate3d pushes CSS animations into hardware acceleration.
Even if you're looking to do a basic 2d translation, use translate3d for more power!
If your animation is still flickering after switching to the transform above,
@ttys3
ttys3 / tohex.lua
Created April 19, 2021 13:30 — forked from yi/gist:01e3ab762838d567e65d
lua fromhex and tohex function
function string.fromhex(str)
return (str:gsub('..', function (cc)
return string.char(tonumber(cc, 16))
end))
end
function string.tohex(str)
return (str:gsub('.', function (c)
return string.format('%02X', string.byte(c))
end))
@ttys3
ttys3 / tproxy.sh
Created April 10, 2021 15:05
tproxy.sh for clash
#!/bin/sh
# @author: ttyS3
# transparent proxy for clash
#ref to https://en.wikipedia.org/wiki/Reserved_IP_addresses
func_get_reserved_ip_addr() {
cat <<-EOF
0.0.0.0/8
10.0.0.0/8
100.64.0.0/10
@ttys3
ttys3 / colorscheme_generator.lua
Created April 1, 2021 12:32 — forked from shadmansaleh/colorscheme_generator.lua
Genarates colorscheme for corrent highlights in neovim
-- This file creates a colorscheme from aleady available colorscheme
-- Author : Shadman Saleh
-- Licence : You can do whatever you want with it but do provide proper cradit
-- Uses :
-- 1. Copy this script to any &rtp/lua folder mostlikely ~/.config/nvim/lua
-- so the script can be required
-- 2. Eun :lua require('colorscheme_genarator').create('colorscheme_name', load_colorscheme)
-- colorscheme_name is the name of colorzcheme load_colorscheme is a boolean
@ttys3
ttys3 / doom.txt
Created February 17, 2021 13:20 — forked from hjertnes/doom.txt
Doom Emacs Cheatsheet
SPC
SPC: find file
, switch buffer
. browse files
: MX
; EX
< switch buffer
` eval
u universal arg
x pop up scratch
@ttys3
ttys3 / colorize-emacs.bashsource
Created February 16, 2021 17:07 — forked from algal/colorize-emacs.bashsource
Setting up truecolor (24 bit color) in emacs in the terminal, under iTerm2
# sourcing this file will define a bash functions that
# tries to run subsequent calls to emacs with 24 bit color.
#
# It sets TERM to xterm-24bit if we're running in iTerm2
# and we've created a user-local terminfo record for xterm-24bit
#
# This will cause emacs to use 24 bit color only when it will work,
# inside or outside of tmux
#
# details: https://gist.github.com/XVilka/8346728
@ttys3
ttys3 / Don't use Vim.md
Created January 27, 2021 05:48 — forked from romainl/Don't use Vim.md
Don't use Vim for the wrong reasons

Don't use Vim

Don't do the crime, if you can't do the time.

-- Anthony Vincenzo "Tony" Baretta

Vim is an amazing text editor. I love it. Really, I wouldn't [organize][organize] a Vim advent calendar if I didn't. But, as amazing as it is, Vim is not for everyone. It can't solve all your problems, or be a TUI version of your favorite IDE, or make you a better programmer, or land you that dream job in the Bay Area. But Vim can help you be more mindful, focused, and efficient, as long as you approach it with the right mindset.

Don't get me wrong, I certainly welcome you to try Vim, but I'm not a proselyte. I don't thrive on newbies. I just want you to use the right tool for the job and not waste your—and anyone's—time on a fruitless quest.

@ttys3
ttys3 / gruvbox-material-alacritty.yml
Created January 16, 2021 03:33 — forked from sainnhe/gruvbox-material-alacritty.yml
Gruvbox Material for Alacritty
# The definition of color schemes.
schemes:
gruvbox_material_hard_dark: &gruvbox_material_hard_dark
primary:
background: '0x1d2021'
foreground: '0xd4be98'
normal:
black: '0x32302f'
red: '0xea6962'
green: '0xa9b665'