This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Evaluate prompt | |
setopt prompt_subst | |
# History config | |
HISTFILE=~/.histfile | |
HISTSIZE=1000 | |
SAVEHIST=1000 | |
# VIM key bindings | |
bindkey -v | |
# Key bindings for 'home' and 'end' | |
bindkey "^[[1~" beginning-of-line |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
epfd = epoll_create(1); | |
if (epfd == -1) | |
errExit("epoll_create"); | |
ev.events = EPOLLIN; | |
ev.data.fd = sockfd; | |
epoll_ctl(epfd, EPOLL_CTL_ADD, sockfd, &ev); | |
ev.events = EPOLLIN; | |
ev.data.fd = STDIN_FILENO; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import signal | |
class SignalBlocker: | |
def __init__(self, signal): | |
self._signal = signal | |
self._signal_blocked = False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* For reference see: | |
* http://www.franken-business.de/galileo-computing/c-von-a-bis-z/022_c_algorithmen_003.htm#mj925248949647af9ef7f16d215f433a8c | |
* http://www.algorithm-code.com/wiki/Insertion_sort#C_Code | |
*/ | |
#include <stdio.h> | |
void insertion_sort(int arr[], int n) { | |
int i, j, x; | |
for (i = 1; i < n; i++) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# setup.py | |
setup( | |
# [...] | |
version=__import__('example').__version__, | |
# [...] | |
) | |
# example/__init__.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Stripped down Nginx config file for example.com | |
worker_processes 1; | |
events { | |
worker_connections 1024; | |
} | |
http { | |
include mime.types; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# file: /etc/event.d/nginx | |
description "Nginx HTTP server" | |
start on runlevel [2345] | |
stop on runlevel [!2345] | |
respawn | |
exec /usr/sbin/nginx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/var/log/nginx/*.log { | |
daily | |
missingok | |
rotate 52 | |
compress | |
delaycompress | |
notifempty | |
create 640 root adm | |
sharedscripts | |
postrotate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Usage: $./hs-wlan-login username | |
# Author: Simon Westphahl <westphahl@gmail.com> | |
# Required (Ubuntu): zenity, libnotify-bin, curl | |
if test -z "$1" | |
then exit | |
else | |
USERNAME=$1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Author: Simon Westphahl <westphahl@gmail.com> | |
Description: Testing hash distribution for multiplication and modulo. | |
""" | |
from math import sqrt, floor | |
text = "Loraem ipbsum dcolor sdit ameet cosetetur sadpscing eltr seed dgam nosumy eird temdfpor inidunt udft lbore edft dlore mgasdna aquyam eabrat stied dfiam volptua Atat veron eods eukt ascsam ennt jullsto duno dors ehfht eajt rbum Stimet citlla kabsd gbergren notre sklma tkitatta sanlicttus ermist Lopprem isrum dmuolor siast amppet" | |
word_list = text.split() |
OlderNewer