Skip to content

Instantly share code, notes, and snippets.

Adam Mizerski etam

Block or report user

Report or block etam

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 kovan.txt
0x972A1ec91DBdECF2813E32d5257e438f003564a7
@etam
etam / Makefile
Last active May 8, 2017
Makefile for a single binary with mixed C and C++ sources
View Makefile
CC := gcc
CXX := g++
CPPFLAGS :=
CFLAGS := -std=c11 -O2 -Wall -Wextra
CXXFLAGS := -std=c++14 -O2 -Wall -Wextra
LDFLAGS :=
LDLIBS := -lstdc++
COBJS :=
CXXOBJS := main.o
OBJS := $(COBJS) $(CXXOBJS)
@etam
etam / Makefile
Last active May 8, 2017
Makefile for a single c++ binary
View Makefile
CC := gcc
CXX := g++
CPPFLAGS :=
CXXFLAGS := -std=c++14 -O2 -Wall -Wextra
LDFLAGS :=
LDLIBS := -lstdc++
OBJS := main.o
EXE := main
all: $(EXE)
View primes.cpp
/*
primes = filterPrime [2..]
where filterPrime (p:xs) =
p : filterPrime [x | x <- xs, x `mod` p /= 0]
main = print $ take 10 primes
*/
#include <iostream>
View fake_daemon.sh
#!/bin/bash
numeric_or_default() {
local -i val="$1"
local -i default="$2"
if [[ "$1" == "$val" ]]; then
echo "$val"
else
echo "$default"
fi
View keybase.md

Keybase proof

I hereby claim:

  • I am etam on github.
  • I am etam (https://keybase.io/etam) on keybase.
  • I have a public key whose fingerprint is A903 6A19 7959 3292 CC5B 7BBC CCF4 9B90 CAF7 07C1

To claim this, I am signing this object:

@etam
etam / restart_plasma.sh
Last active Nov 18, 2016
restart plasma
View restart_plasma.sh
#!/bin/bash
kquitapp5 plasmashell
sleep 1
kstart5 plasmashell
View vbox-serial
#!/bin/bash
if (( $# != 1 )); then
echo "Usage: $(basename "$0") /tmp/path/to/socket"
exit 1
fi
if [[ ! -S "$1" ]]; then
echo "$1 is not a socket"
exit 2
View mksum
#!/bin/bash
if (( $# != 3 )); then
echo "usage: $(basename "$0") type hash filename"
exit 1
fi
type="$1"
hash="$2"
filename="$3"
View separate-debug
#!/bin/bash
while (( $# > 0 )); do
objcopy --only-keep-debug "$1" "${1}.debug"
strip -g "$1"
objcopy --add-gnu-debuglink="${1}.debug" "$1"
shift
done
You can’t perform that action at this time.