Skip to content

Instantly share code, notes, and snippets.

💻
Typing on a Colemak keyboard layout

Salif Mehmed salifm

💻
Typing on a Colemak keyboard layout
Block or report user

Report or block salifm

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@salifm
salifm / layout.kbd.json
Created Dec 16, 2019
Untitled Keyboard Layout
View layout.kbd.json
[
[
{
"a": 7,
"fa": [
6
],
"w": 1.25
},
"Tab",
@salifm
salifm / trim_space.c
Created Jun 29, 2019 — forked from kenkam/trim_space.c
A simple function to trim some space off a string in C
View trim_space.c
char * trim_space(char *str) {
char *end;
/* skip leading whitespace */
while (isspace(*str)) {
str = str + 1;
}
/* remove trailing whitespace */
end = str + strlen(str) - 1;
while (end > str && isspace(*end)) {
end = end - 1;
View gist:9c5f0a5e1a089d3020d33902d8558f6b
polybar config
[module/date]
type = custom/script
exec = ~/scripts/popup-calendar.sh
interval = 5
click-left = ~/scripts/popup-calendar.sh --popup
format-background = ${colors.alt-background}
format-foreground = ${colors.alt-foreground}
label = %output:25%
View code_style.md

My preferred code style is 2-space K&R. This is intended to provide a justification for this style.

Why K&R?

K&R style has the following properties:

  1. Provides symmetric size (in terms of screen space consumed) between the opening and closing syntax of a clode block.
  2. Forces no empty/meaningless lines, thereby avoiding artificial distance between related things that should be together.
  3. Consumes the minimum vertical space while keeping the opening and closing syntax of the block on separate lines from the content.
@salifm
salifm / noscript-tracking.go
Created May 10, 2019 — forked from wybiral/noscript-tracking.go
Tracking cursor position in real-time with remote monitoring (without JavaScript)
View noscript-tracking.go
// Tracking cursor position in real-time without JavaScript
// Demo: https://twitter.com/davywtf/status/1124146339259002881
package main
import (
"fmt"
"net/http"
"strings"
)
@salifm
salifm / archlinux_install.sh
Created Apr 19, 2019 — forked from dangkhoasdc/archlinux_install.sh
Things to do after install Arch Linux
View archlinux_install.sh
#!/usr/bin/env bash
# Things to do after install ArchLinux (2012.12.01)
pacman --noconfirm -S sudo
# Enabled archlinuxfr repo
arch=$(uname -m)
sudo cp /etc/pacman.conf /etc/pacman.conf.bak
echo "" >> /etc/pacman.conf
echo "[archlinuxfr]" >> /etc/pacman.conf
@salifm
salifm / encrypt-all.sh
Created Apr 8, 2019 — forked from johnnyopao/encrypt-all.sh
GPG Encrypt all files in directory
View encrypt-all.sh
#!/bin/bash
# This uses gpg to encrypt every file in a directory as separate
# encrypted files
# Usage
# ./encrypt-all.sh ./dir-of-files-to-encrypt "PASSPHRASE"
FILES="$1"
PASSPHRASE="$2"
View XAMPP-Launcher.md

XAMPP Launcher

Create file XAMPP.desktop and make it contain:

[Desktop Entry]
Name=XAMPP
GenericName=XAMPP
Encoding=UTF-8
Exec=xampp
@salifm
salifm / language-sampleGrammar.cson
Created Mar 17, 2019 — forked from DamnedScholar/language-sampleGrammar.cson
Grammar boilerplate with annotations.
View language-sampleGrammar.cson
# TextMate tutorial: http://manual.macromates.com/en/language_grammars
# Regex to convert keys to unquoted: '(include|match|captures|begin|end|beginCaptures|endCaptures|name|patterns|0|1|2|3|4|5|6|7|8|9|comment|fileTypes|scopeName|repository|contentName|firstLineMatch|foldingStartMarker|foldingStopMarker)':
scopeName: 'source.<scope>' # <scope> should be a short, unique indicator for the language ("js", "php", "c", etc.)
name: '<name>' # The title that will show up in grammar selection and on your status bar.
fileTypes: [ # An array of file extensions.
'txt'
'exif'
]
@salifm
salifm / README-Template.md
Created Feb 5, 2019 — forked from PurpleBooth/README-Template.md
A template to make good README.md
View README-Template.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

You can’t perform that action at this time.