Skip to content

Instantly share code, notes, and snippets.

Dimitri Sokolyuk dim13

Block or report user

Report or block dim13

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View LOR bench switch vs array
#include <stdio.h>
#include <time.h>
int
dummy(int n)
{
return -1;
}
#define nelem(x) (sizeof(x) / sizeof((x)[0]))
View keybase.md

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:

View xsession
#!/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`
View XTerm TangoDark
! Color scheme: TangoDark
*foreground: #ffffff
*background: #000000
*cursorColor: #ffffff
! Black
*color0: #000000
*color8: #545753
! Red
*color1: #cc0000
*color9: #ef2828
View Go Makefile
DEPS=$(shell go list -f '{{join .Deps " "}}' .)
SRCS=$(shell go list -f '{{range .GoFiles}}{{$$.Dir}}/{{.}} {{end}}' ${DEPS} .)
app: ${SRCS}
go build -o $@ .
View OpenBSD update
#!/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 Nov 20, 2018
Mirror all go releases (OpenBSD Make)
View Makefile
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
View xkb
# 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"
View 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 Aug 9, 2019
try/catch in plain c
View try.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)
You can’t perform that action at this time.