Skip to content

Instantly share code, notes, and snippets.

@Simhyeon
Simhyeon / .Xmodmap
Last active Apr 15, 2021
Xmodmap example
View .Xmodmap
! --------------<DESCRIPTION>-------------------
! I'm changing left alt key to mode switch and menu key to alt key.
! If i really need alt keys a lot, then I use normal key map for the time.
! Every keyname is represented as capital but not the capital in real use.
! If you want to change xmodmap by your flavor refer to the table in the bottom of this file.
! Also Arch wiki is a great resource.
! https://wiki.archlinux.org/index.php/Xmodmap
! Keycode can be detected with xev command just open up your terminal and type xev to find out.
!
! Below is a short description for my keymappings
@boreycutts
boreycutts / i3-gaps_installation_guide.md
Last active Apr 15, 2021
A simple installation guide for i3-gaps
View i3-gaps_installation_guide.md

Installing i3-gaps

Dependencies

i3-gaps has some packages that are required for it to work so install these things:

sudo apt install libxcb1-dev libxcb-keysyms1-dev libpango1.0-dev libxcb-util0-dev libxcb-icccm4-dev libyajl-dev libstartup-notification0-dev libxcb-randr0-dev libev-dev libxcb-cursor-dev libxcb-xinerama0-dev libxcb-xkb-dev libxkbcommon-dev libxkbcommon-x11-dev autoconf xutils-dev libtool automake

You also need to install libxcb-xrm-dev, but I got Unable to locate package libxcb-xrm-dev when trying to install from the apt repositories on Ubuntu 16.04. If this happens to you, just install it from source using these commands:

mkdir tmp
View kontextwork_d4m_fix.sh
#!/bin/bash
set -e
cd ~/Library/Containers/com.docker.docker/Data/database
git reset --hard
echo -n "Current full-sync-on-flush setting: "
P=~/Library/Containers/com.docker.docker/Data/database/com.docker.driver.amd64-linux/disk/full-sync-on-flush
if [ -f $P ]; then
echo "file exists"
@tinogomes
tinogomes / gist:2476447
Created Apr 24, 2012
Open the Color Picker via AppleScript
View gist:2476447
# Open the Color Picker via AppleScript
# http://qsapp.com/wiki/Color_Picker_(AppleScript)
tell application "System Events" to set _frontMostApp to (name of processes whose frontmost is true)
set _frontMostApp to item 1 of _frontMostApp
tell application _frontMostApp to activate
choose color
View defining-variables.go
package main
import "fmt"
func main() {
/*
Recap:
In formatted string,
%d stands for integers
@cvan
cvan / webgl-detect-gpu.js
Last active Apr 15, 2021
use JavaScript to detect GPU used from within your browser
View webgl-detect-gpu.js
var canvas = document.createElement('canvas');
var gl;
var debugInfo;
var vendor;
var renderer;
try {
gl = canvas.getContext('webgl') || canvas.getContext('experimental-webgl');
} catch (e) {
}
@ole1986
ole1986 / traffic-control.sh
Last active Apr 15, 2021
Traffic control script for incoming and outgoing packages using TC (on a specific ip address)
View traffic-control.sh
#!/bin/bash
VERSION="1.0.2"
# Interface connect to out lan
INTERFACE="eth0"
# Interface virtual for incomming traffic
VIRTUAL="ifb0"
# set the direction (1 = outgoing only, 2 = incoming only 3 = both)
DIRECTION=3
# Speed
@Painezor
Painezor / Checks.py
Last active Apr 15, 2021
Built-in Checks for the commands extension of discord py
View Checks.py
@commands.guild_only()
# Command cannot be used in private messages.
@commands.dm_only()
# Command can only be used in private messages.
@commands.is_owner()
# Command can only be used by the bot owner.
@commands.is_nsfw()