Skip to content

Instantly share code, notes, and snippets.

View AriaMoradi's full-sized avatar
🏠
Working from home

Aria Moradi AriaMoradi

🏠
Working from home
View GitHub Profile
@fikovnik
fikovnik / getxkblayout.c
Created February 7, 2018 09:43
Get keyboard layout using X11
// compile with `gcc -I/usr/include getxkblayout.c -lX11 -lxkbfile`
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <X11/XKBlib.h>
#include <X11/extensions/XKBrules.h>
int main(int argc, char **argv) {
Display *dpy = XOpenDisplay(NULL);
@jpadilla
jpadilla / fields.py
Created February 3, 2014 21:24
CharacterSeparatedField - A Django REST framework field that separates a string with a given separator into a native list and reverts a list into a string separated with a given separator.
from rest_framework import serializers
class CharacterSeparatedField(serializers.WritableField):
"""
A field that separates a string with a given separator into
a native list and reverts a list into a string separated with a given
separator.
"""
def __init__(self, *args, **kwargs):
@icot
icot / Xresources
Created November 18, 2012 16:36
urxvt color configuration
urxvt.foreground: White
urxvt.saveLines: 20000
urxvt.scrollBar: off
urxvt.font: xft:inconsolata:size=10:autohint=true:antialias=true
urxvt*foreground: #f2f2f2
!urxvt*background: #101010
urxvt*background: #002b37