Skip to content

Instantly share code, notes, and snippets.

View salif's full-sized avatar

Salif Mehmed salif

View GitHub Profile
@bert
bert / gtk_entry_insert_text_comment.c
Created December 19, 2009 14:48
GTK entry insert text comment snippet
/*!
* \file gtk_entry_insert_text_comment.c
* \brief
*
* The algorithms here will work as long as the text size (a
* multiple of 2), fits into a guint16. We specify a shorter
* maximum length so that if the user pastes a very long text, there
* is not a long hang from the slow X_LOCALE functions.
*/
@bert
bert / gist:267960
Created January 3, 2010 12:42
GTK expose event and handler example
/*!
* \file
* \brief
*/
#include <gtk/gtk.h>
/*!
@kenkam
kenkam / trim_space.c
Created January 21, 2011 17:58
A simple function to trim some space off a string in 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;
@mojavelinux
mojavelinux / Writing Tools Writeup.markdown
Created January 30, 2012 18:56 — forked from matthewmccullough/Writing Tools Writeup.md
How To Write A Technical Book (One Man's Modest Suggestions)
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout somewhen, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see http://i3wm.org/docs/userguide.html for a complete reference!
@paulmillr
paulmillr / active.md
Last active November 19, 2024 18:29
Most active GitHub users (by contributions). http://twitter.com/paulmillr

Most active GitHub users (git.io/top)

The list would not be updated for now. Don't write comments.

The count of contributions (summary of Pull Requests, opened issues and commits) to public repos at GitHub.com from Wed, 21 Sep 2022 till Thu, 21 Sep 2023.

Because of GitHub search limitations, only 1000 first users according to amount of followers are included. If you are not in the list you don't have enough followers. See raw data and source code. Algorithm in pseudocode:

githubUsers
@iperelivskiy
iperelivskiy / hash.js
Created November 19, 2012 14:39
JS simple hash function
var hash = function(s) {
/* Simple hash function. */
var a = 1, c = 0, h, o;
if (s) {
a = 0;
/*jshint plusplus:false bitwise:false*/
for (h = s.length - 1; h >= 0; h--) {
o = s.charCodeAt(h);
a = (a<<6&268435455) + o + (o<<14);
c = a & 266338304;
@deekayen
deekayen / 1-1000.txt
Last active November 2, 2024 22:00
1,000 most common US English words
the
of
to
and
a
in
is
it
you
that
@dgellow
dgellow / evdev.xml
Created July 3, 2013 07:07
Custom /usr/share/X11/xkb/rules/evdev.xml to add my custom bepow layout to gnome 3 settings
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xkbConfigRegistry SYSTEM "xkb.dtd">
<xkbConfigRegistry version="1.1">
<modelList>
<model>
<configItem>
<name>pc101</name>
<description>Generic 101-key PC</description>
<vendor>Generic</vendor>
</configItem>
@dangkhoasdc
dangkhoasdc / archlinux_install.sh
Last active March 18, 2021 09:20
Things to do after install Arch Linux
#!/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