Skip to content

Instantly share code, notes, and snippets.

View dim13's full-sized avatar
🇺🇦
Кто к нам с чем зачем, тот от того и того!

Dimitri Sokolyuk dim13

🇺🇦
Кто к нам с чем зачем, тот от того и того!
View GitHub Profile
#include <stdio.h>
#include <time.h>
int
dummy(int n)
{
return -1;
}
#define nelem(x) (sizeof(x) / sizeof((x)[0]))

Keybase proof

I hereby claim:

  • I am dim13 on github.
  • I am dim13 (https://keybase.io/dim13) on keybase.
  • I have a public key ASCTTIbRFnm23C-0oSxxdMUrKTI90mpSiyWCRE9vNssIfwo

To claim this, I am signing this object:

@dim13
dim13 / xsession
Last active April 30, 2017 21:15
#!/bin/sh
export XUSERFILESEARCHPATH=$HOME/%N:$HOME/app-defaults/%N
setxkbmap -layout "us,ru" -option "grp:alt_space_toggle,grp_led:caps,caps:escape,compose:102"
eval `ssh-agent -s`
ssh-add < /dev/null
cwm
eval `ssh-agent -s -k`
! Color scheme: TangoDark
*foreground: #ffffff
*background: #000000
*cursorColor: #ffffff
! Black
*color0: #000000
*color8: #545753
! Red
*color1: #cc0000
*color9: #ef2828
DEPS=$(shell go list -f '{{join .Deps " "}}' .)
SRCS=$(shell go list -f '{{range .GoFiles}}{{$$.Dir}}/{{.}} {{end}}' ${DEPS} .)
app: ${SRCS}
go build -o $@ .
#!/bin/sh
#
VERSION=OPENBSD_$(uname -r | tr . _)
MODULES='src ports xenocara'
CVSROOT=anoncvs@anoncvs.eu.openbsd.org:/cvs
export ${CVSROOT}
cd /usr
cvs -d ${CVSROOT} up -r${VERSION} -ACPd ${MODULES}
@dim13
dim13 / Makefile
Created November 20, 2018 22:29
Mirror all go releases (OpenBSD Make)
SRC:= 1.2.2
SRC+= 1.3 1.3.1 1.3.2 1.3.3
SRC+= 1.4 1.4.1 1.4.2 1.4.3
SRC+= 1.5 1.5.1 1.5.2 1.5.3 1.5.4
SRC+= 1.6 1.6.1 1.6.2 1.6.3 1.6.4
SRC+= 1.7 1.7.1 1.7.3 1.7.4 1.7.5 1.7.6
SRC+= 1.8 1.8.1 1.8.2 1.8.3 1.8.4 1.8.5 1.8.6 1.8.7
SRC+= 1.9 1.9.1 1.9.2 1.9.3 1.9.4 1.9.5 1.9.6 1.9.7
SRC+= 1.10 1.10.1 1.10.2 1.10.3 1.10.4 1.10.5
SRC+= 1.11 1.11.1 1.11.2
@dim13
dim13 / xkb
Created December 20, 2018 09:53
# KEYBOARD CONFIGURATION FILE
# Consult the keyboard(5) manual page.
XKBMODEL="pc105"
XKBLAYOUT="us,ru"
XKBVARIANT=","
XKBOPTIONS="compose:102,caps:escape,grp:alt_space_toggle"
BACKSPACE="guess"
@dim13
dim13 / git-license
Created July 31, 2019 14:05
git license
#!/bin/sh
YEAR=`date +%Y`
NAME=`git config user.name`
MAIL=`git config user.email`
cat <<EOF>LICENSE
Copyright (c) $YEAR $NAME <$MAIL>
Permission to use, copy, modify, and distribute this software for any
@dim13
dim13 / try.c
Created August 9, 2019 12:28
try/catch in plain c
#include <err.h>
#include <stdio.h>
#include <setjmp.h>
#include <signal.h>
static sigjmp_buf exception;
#define try if (!sigsetjmp(exception, 1))
#define catch else
#define throw siglongjmp(exception, 1)