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
The "right-left" rule is a completely regular rule for deciphering C | |
declarations. It can also be useful in creating them. | |
First, symbols. Read | |
* as "pointer to" - always on the left side | |
[] as "array of" - always on the right side | |
() as "function returning" - always on the right side | |
as you encounter them in the declaration. |
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 -e | |
declare -i f=75 s=13 r=5000 t=0 c=1 n=0 l=0 | |
declare -i x=$((w/2)) y=$((h/2)) | |
declare -ar v=( [00]="\x83" [01]="\x8f" [03]="\x93" | |
[10]="\x9b" [11]="\x81" [12]="\x93" | |
[21]="\x97" [22]="\x83" [23]="\x9b" | |
[30]="\x97" [32]="\x8f" [33]="\x81" | |
) | |
trap "clear; tput rmcup; tput cnorm" EXIT |
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
# Makefile for mparser - see UNLICENSE for nonlicense and noncopyright information | |
VERSION = cookies-git | |
NAME = mparser | |
PREFIX ?= /usr/local | |
BINDIR ?= ${PREFIX}/bin | |
INCS = -I. -I/usr/include | |
LIBS = -L/usr/lib -lc |
We can't make this file beautiful and searchable because it's too large.
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
AQCod,AAA,ALect,ACorr,ASound | |
1,1,"Περνάτε στην 3η ταχύτητα.",1,"SA-1-1" | |
1,2,"Περνάτε στην 5η ταχύτητα.",0,"SA-1-2" | |
2,1,"Εννέα και τέταρτο ως δέκα και δέκα.",1,"SA-2-1" | |
2,2,"Εννέα.",0,"SA-2-2" | |
2,3,"Έντεκα και πέντε.",0,"SA-2-3" | |
3,1,"Έχετε «βάλει» την 1η ταχύτητα και πιέζετε τον ποδομοχλό του συμπλέκτη.",0,"SA-3-1" | |
3,2,"Έχετε το μοχλό ταχυτήτων στη «νεκρά» και πιέζετε τον ποδομοχλό της πέδης (φρένο).",1,"SA-3-2" | |
3,3,"Έχετε το μοχλό ταχυτήτων στη «νεκρά» και πιέζετε τον ποδομοχλό του συμπλέκτη.",0,"SA-3-3" | |
4,1,"Μόνο όταν έχετε πρόθεση να αλλάξετε κατεύθυνση προς τα αριστερά.",0,"SA-4-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
ff="/tmp/monsterwm.fifo" | |
[[ -p $ff ]] || mkfifo -m 600 "$ff" | |
# desktop names | |
ds=("web" "dev" "foo" "null") | |
# layout names | |
ms=("T" "M" "B" "G" "F") | |
while read -t 60 -r wmout || true; do |
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
// branching function: | |
// inline int abs(int x) | |
// { | |
// return (x<0) ? -x : x; | |
// } | |
inline int abs_no_branch(int x) | |
{ | |
int m = (x >> (8 * sizeof(int)-1)); | |
return ((x ^ m) - m); |
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
diff --git a/src/xlib.c b/src/xlib.c | |
index 393617d..9940eb3 100644 | |
--- a/src/xlib.c | |
+++ b/src/xlib.c | |
@@ -201,9 +201,13 @@ void handlekeypress(XEvent *event){ | |
key_action(); | |
break; | |
case XK_j: | |
+ case XK_l: | |
+ case XK_Right: |
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 | |
current=0 | |
completed=0 | |
read -r total _ < <(/bin/du -bc "${@:1:${#}-1}" | tail -n1) | |
/bin/cp $@ & | |
while (( current != total )); do |
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/sh | |
localdir="/tmp/test" # which directory to check | |
filelist="/tmp/filelist" # where to store regular file names | |
symlist="/tmp/symlist" # where to store symlinks file names | |
results="/tmp/results" # where to store file names that have no symlink pointed to them | |
cd "$localdir" | |
# seperate files and symlinks |
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/sh | |
cacheip="/etc/ip.cache" | |
checkurl='http://freedns.afraid.org/dynamic/check.php' | |
updateurl='http://freedns.afraid.org/dynamic/update.php?xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' | |
[ -r "${cacheip}" ] && read -r _date _time _oldip <<< "$(tail -1 "${cacheip}")" | |
_newip="$(wget "$checkurl" -o /dev/null -O /dev/stdout | sed -n 's/^Detected.*: \(.\+\)/\1/p')" | |
[ "${_newip}" == "${_oldip}" ] && printf "IP has not changed: %s\n" "${_newip}" && exit 0 |