Skip to content

Instantly share code, notes, and snippets.

Avatar

Yana Timoshenko alpakido

View GitHub Profile
View choir.erl
-module(choir).
-export([start/0, start_world/0, say/1, say/3]).
start() -> register(?MODULE, spawn(fun loop/0)).
loop() ->
receive {Message, Voice} ->
os:cmd(io_lib:format("say -v '~s' '~s'", [Voice, Message])),
loop()
end.
@alpakido
alpakido / fizzbuzz.c
Last active Nov 29, 2021
Overengineered fizzbuzz in C
View fizzbuzz.c
#include <stdio.h>
#include <string.h>
#define BUFLEN 9
int main() {
char buf[BUFLEN];
FILE *stream = fmemopen(&buf, BUFLEN, "w");
if (stream == NULL) {
View example.cue
FILE "example.bin" BINARY
TRACK 01 MODE2/2352
INDEX 01 00:00:00
View hq9+.rb
@accumulator = 0
@beer = ''; 97.times do |n|
@beer << "
#{99-n} bottles of beer on the wall,
#{99-n} bottles of beer.
Take one down and pass it around,
#{98-n} bottles of beer on the wall.
"
end; @beer << "
2 bottles of beer on the wall,
View reject-poison-keys.diff
diff -r 59f916c737be keydb.ml
--- a/keydb.ml Tue Oct 23 00:56:31 2018 +0000
+++ b/keydb.ml Tue Jan 22 14:09:31 2019 +0300
@@ -1166,6 +1166,12 @@
try
if has_hash hash then [] else
let keyid = Fingerprint.keyid_from_key ~short:true key in
+ let keyid_long = Fingerprint.keyid_to_string ~short:false (Fingerprint.keyid_from_key ~short:false key) in
+ plerror 4 "considering keyid %s" keyid_long;
+ if List.mem keyid_long [
View default.nix
with import <nixpkgs> {};
let
inherit (callPackage (fetchGit {
url = https://gitlab.com/transumption/mix-to-nix;
rev = "b70cb8f7fca80d0c5f7539dbfec497535e07d75c";
}) {}) mixToNix;
# Fake config, required for compilation
prodSecret = writeText "prod.secret.exs" ''
@alpakido
alpakido / cljack-in
Last active Feb 1, 2019
Project-independent nREPL setup for Clojure CLI
View cljack-in
#!/bin/sh
exec clj -Sdeps '{:deps {cider/cider-nrepl {:mvn/version "0.20.0"}}}' \
-e '(require `cider-nrepl.main)
(cider-nrepl.main/init ["cider.nrepl/cider-middleware"])'
View divinity-original-sin-2.sh
#!/bin/sh
STEAM_PATH=$HOME/.steam/debian-installation
cd "$STEAM_PATH/steamapps/common/Divinity Original Sin 2"
rm -r bin
ln -s DefEd/bin .
rm bin/SupportTool.exe
@alpakido
alpakido / config.seed
Last active Apr 11, 2019
OpenWrt .config for Zyxel Keenetic (w/ LuCI)
View config.seed
CONFIG_TARGET_ramips=y
CONFIG_TARGET_ramips_rt305x=y
CONFIG_TARGET_ramips_rt305x_DEVICE_kn=y
CONFIG_CLEAN_IPKG=y
CONFIG_LUCI_SRCDIET=y
# CONFIG_PACKAGE_kmod-ppp is not set
CONFIG_PACKAGE_libiwinfo-lua=y
CONFIG_PACKAGE_liblua=y
CONFIG_PACKAGE_liblucihttp=y
CONFIG_PACKAGE_liblucihttp-lua=y
View rb951g-2hnd.diff
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-rb95x.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-rb95x.c
index 33c4f53133..c4cf5f12a8 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-rb95x.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-rb95x.c
@@ -266,6 +266,7 @@ static void __init rb951g_setup(void)
return;
ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_RGMII_GMAC0 |
+ AR934X_ETH_CFG_RXD_DELAY |
AR934X_ETH_CFG_SW_ONLY_MODE);