Skip to content

Instantly share code, notes, and snippets.

View dragonly's full-sized avatar
🎯
Focusing

Yilong Li dragonly

🎯
Focusing
View GitHub Profile
@morgangiraud
morgangiraud / nvidia-reinstall.sh
Last active December 11, 2020 15:48
Script to reinstall manually nvidia drivers,cuda 9.0 and cudnn 7.1 on Ubuntu 16.04
# Remove anything linked to nvidia
sudo apt-get remove --purge nvidia*
sudo apt-get autoremove
# Search for your driver
apt search nvidia
# Select one driver (the last one is a decent choice)
sudo apt install nvidia-370
@dragonly
dragonly / pretty git log
Last active June 18, 2021 02:04
git log visualization
# put this in your ~/.gitconfig, then issue `git lg` will get you a pretty git branch topology view
#
# this is just a start point, customizations can be done by further fine tuning referencing
# https://git-scm.com/docs/git-log & https://git-scm.com/docs/pretty-formats
#
# --graph draws the git commits tree
# --date=local is used in the following --format
#
# format explanation:
# %C(colorname)xxx%C(reset) encloses text `xxx` with color `colorname`
@mebens
mebens / gist:4218802
Created December 5, 2012 19:36
Simple glow/bloom GLSL shader for Love2D
// adapted from http://www.youtube.com/watch?v=qNM0k522R7o
extern vec2 size;
extern int samples = 5; // pixels per axis; higher = bigger glow, worse performance
extern float quality = 2.5; // lower = smaller glow, better quality
vec4 effect(vec4 colour, Image tex, vec2 tc, vec2 sc)
{
vec4 source = Texel(tex, tc);
vec4 sum = vec4(0);
@MaskRay
MaskRay / implement-an-elf-linker.md
Last active April 12, 2024 07:27
Implement an ELF linker
theme class highlighter fonts
default
text-center
MaskRay
sans serif mono
sans-serif
serif
monospace
@branneman
branneman / better-nodejs-require-paths.md
Last active April 27, 2024 04:16
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

const Article = require('../../../../app/models/article');

Those suck for maintenance and they're ugly.

Possible solutions

@StevenACoffman
StevenACoffman / Homoglyphs.md
Last active April 27, 2024 22:45
Unicode Look-alikes

Unicode Character Look-Alikes

Original Letter Look-Alike(s)
a а ạ ą ä à á ą
c с ƈ ċ
d ԁ ɗ
e е ẹ ė é è
g ġ
h һ
@staltz
staltz / introrx.md
Last active May 3, 2024 13:00
The introduction to Reactive Programming you've been missing
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 3, 2024 19:09
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@jexchan
jexchan / multiple_ssh_setting.md
Created April 10, 2012 15:00
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@xirixiz
xirixiz / Set up GitHub push with SSH keys.md
Last active May 4, 2024 11:08 — forked from developius/README.md
Set up GitHub push with SSH keys

SSH keypair setup for GitHub (or GitHub/GitLab/BitBucket, etc, etc)

Create a repo.

Make sure there is at least one file in it (even just the README.md)

Generate a SSH key pair (private/public):

ssh-keygen -t rsa -C "your_email@example.com"