Skip to content

Instantly share code, notes, and snippets.

-- ghci haspl.hs
-- do a <- readFile "./kompilator/tests/25.spl"; parseTest splprog a
import Control.Monad (void)
import Data.Void
import Text.Megaparsec
import Text.Megaparsec.Char
import Text.Megaparsec.Expr hiding (Operator)
import Data.List
import qualified Text.Megaparsec.Char.Lexer as L
;;; nix-mode.el --- Major mode for editing .nix files -*- lexical-binding: t -*-
;; Maintainer: Matthew Bauer <mjbauer95@gmail.com>
;; Homepage: https://github.com/NixOS/nix-mode
;; Version: 1.2.1
;; Keywords: nix, languages, tools, unix
;; Package-Requires: ((emacs "24.3"))
;; This file is NOT part of GNU Emacs.
# Do not modify this file! It was generated by ‘nixos-generate-config’
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, ... }:
{
imports =
[ <nixpkgs/nixos/modules/installer/scan/not-detected.nix>
];
Success!!
Congratulations, you have finished the challenge. Below are listings of your last submitted programs.
Program 1
l1 = h1;
l2 = h2;
l3 = h3;
l4 = h4;
l5 = h5;
l6 = h6;
@yorickvP
yorickvP / generate.sh
Created April 16, 2018 19:19
this is what i'm doing now
node keys.js > ./keys.json
nix eval '(builtins.fromJSON builtins.readFile(./keys.json))'
@yorickvP
yorickvP / filter_tcp_80.py
Last active April 2, 2018 14:37
auto audit extravaganza
# asserts: 64-bit
# auditd running
# sudo auditctl -a exit,always -F arch=b64 -S connect
import codecs, struct, socket, sys, os, re
class AuditLog(object):
def __init__(self):
self.last_event = -1
// ==UserScript==
// @name GH-PR-Approvals
// @namespace http://serokell.io
// @version 0.5
// @updateURL https://gist.githubusercontent.com/yorickvP/e69775e5b8997054103b855aea4103aa/raw/
// @description adds approval count to github PRs
// @author You
// @match https://github.com/*
// @run-at document-start
// @grant unsafeWindow
$ postgres --version
postgres (PostgreSQL) 10.1
# postgresql_jdbc
nix-repl> postgresql_jdbc.src.urls
[ "http://jdbc.postgresql.org/download/postgresql-jdbc-9.3-1100.src.tar.gz" ]
# java
nix-repl> openjdk8.jre.name
"openjdk-8u172b02"
Mar 14 20:57:57 wiki postgresql-start[635]: 2018-03-14 20:57:57.044 GMT [7545] ERROR: column t1.tgconstrname does not exist at character 113
Mar 14 20:57:57 wiki postgresql-start[635]: 2018-03-14 20:57:57.044 GMT [7545] STATEMENT: SELECT DISTINCT NULL::text as pnspname, NULL::text as fnspname, c1.relname as prelname, c2.relname as frelname, t1.tgconstrname, a.attnum as keyseq, ic.relname as fkeyname, t1.tgdeferrable, t1.tginitdeferred, t1.tgnargs,t1.tgargs, p1.proname as updaterule, p2.proname as deleterule FROM pg_class c1 JOIN pg_index i ON (c1.oid=i.indrelid) JOIN pg_class ic ON (i.indexrelid=ic.oid) JOIN pg_attribute a ON (ic.oid=a.attrelid), pg_class c2, pg_trigger t1 JOIN pg_proc p1 ON (t1.tgfoid=p1.oid), pg_trigger t2 JOIN pg_proc p2 ON (t2.tgfoid=p2.oid) WHERE (t1.tgrelid=c1.oid AND t1.tgisconstraint AND t1.tgconstrrelid=c2.oid AND p1.proname ~ '^RI_FKey_.*_upd$') AND (t2.tgrelid=c1.oid AND t2.tgisconstraint AND t2.tgconstrrelid=c2.oid AND p2.proname ~ '^RI_FKey_.*_del$') AND i.indisprimary
@yorickvP
yorickvP / cli.c
Created July 2, 2017 17:33
sss-cli
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include "sss.h"
int cli_create(int argc, const char* argv[]) {
if (argc != 4) return 1;
unsigned long int shares = strtoul(argv[2], NULL, 10);
unsigned long int required = strtoul(argv[3], NULL, 10);