This file contains hidden or 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
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <memory.h> | |
| #include <errno.h> | |
| #include <fcntl.h> | |
| #include <unistd.h> | |
| #include <err.h> | |
| #include <elf.h> | |
| #include <sys/stat.h> | |
| #include <sys/mman.h> |
This file contains hidden or 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
| #include <stdio.h> | |
| #include <stdint.h> | |
| static unsigned colour_table[] = { | |
| 0x24, 0x25, 0x26, 0x27, 0x29, 0x30, 0x31, 0x32, | |
| 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x40, | |
| 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, | |
| 0x49, 0x50, 0x51, 0x59, 0x60, 0x61, 0x62, 0x63, | |
| 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x70, 0x71, | |
| 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, |
This file contains hidden or 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
| CFLAGS := -std=c99 \ | |
| -Wall -Wextra -pedantic \ | |
| -Wshadow -Wpointer-arith -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes \ | |
| -D_GNU_SOURCE \ | |
| ${CFLAGS} | |
| all: search | |
| search: search.o boyermoore.o | |
| clean: |
This file contains hidden or 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 | |
| # startx | |
| # Alternative, simpler startx which makes use of the XDG specification | |
| # - assumes dbus is already running | |
| [[ -n "$DISPLAY" ]] && exit 0 | |
| [[ -z "$XDG_VTNR" ]] && exit 1 | |
| XDG_CONFIG_HOME=${XDG_CONFIG_HOME:-$HOME/.config} | |
| XDG_CACHE_HOME=${XDG_CACHE_HOME:-$HOME/.cache} |
This file contains hidden or 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
| #!/usr/bin/python3 | |
| def make_solution(size): | |
| def exception_queen(i, half): | |
| return 2 * i + half - 3 | |
| def simple_queen(i, half): | |
| return 2 * i - 1 | |
| table = [0] * size |
This file contains hidden or 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
| autoload -U vcs_info | |
| autoload -U colors && colors | |
| autoload -U compinit && compinit | |
| autoload zsh/terminfo | |
| HISTFILE=$HOME/.zsh_history | |
| HISTSIZE=10000 | |
| SAVEHIST=10000 | |
| HISTIGNORE=' ' |
This file contains hidden or 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
| class Configurator: | |
| def __init__(self, defaults, parent=None): | |
| self.store = {} | |
| self.parent = parent | |
| for k, v in defaults.items(): | |
| self.store[k] = (None, v) | |
| def get(self, key): |
This file contains hidden or 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
| #!/usr/bin/python3 | |
| import sys | |
| import itertools | |
| import requests | |
| import xml.etree.ElementTree as ET | |
| from optparse import OptionParser | |
| def nextbus_request(command, agency, route, stop): | |
| params = { 'command': command, |
This file contains hidden or 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
| def next_free_port(host, family, proto): | |
| for res in socket.getaddrinfo(host, '0', family, proto): | |
| (family, socktype, proto, _, sockaddr) = res | |
| with socket.socket(family, socktype) as sock: | |
| sock.bind((sockaddr[0], 0)) | |
| return sock.getsockname()[:2] | |
| print(next_free_port('vodik', socket.AF_INET, socket.SOCK_STREAM)) | |
| print(next_free_port('vodik', socket.AF_INET, socket.SOCK_DGRAM)) |
This file contains hidden or 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
| CFLAGS := -std=c11 \ | |
| -Wall -Wextra -pedantic \ | |
| -Wshadow -Wpointer-arith -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes \ | |
| -D_GNU_SOURCE \ | |
| $(CFLAGS) | |
| LDLIBS = -lpcap -ljansson | |
| all: esl_pcap_trace |