Skip to content

Instantly share code, notes, and snippets.

Avatar

Paulo Köch pkoch

View GitHub Profile
View packageInfo.ts
import fs from 'fs'
import path from 'path'
import * as t from 'io-ts'
import {decode} from 'io-ts-promise';
import {promisify} from 'util'
const readFile = promisify(fs.readFile)
const RelevantPackageFields = t.type({
name: t.string,
View lib.rs
pub fn sounder<'a>(div: u32, msg: &'a str) -> impl Fn(u32) -> Option<&'a str>
{
move |n: u32|{
if n % div != 0 {
return None;
};
Some(msg)
}
}
View gist:9a50b31f91f404acc12236c35a72f47e
commit 1b7d0c1b7ea0c44ec27df33d72306fd9655fa2bb
Author: Paulo Köch <pkoch@frctls.com>
Date: Mon May 13 10:23:18 2019 +0200
Introduce P
diff --git a/app/lib/p.rb b/app/lib/p.rb
new file mode 100644
index 0000000..4f31a50
--- /dev/null
View gist:f275222bce147d9f781c26bb49c05f4c
diff --git a/app/lib/p.rb b/app/lib/p.rb
new file mode 100644
index 0000000..96e939c
--- /dev/null
+++ b/app/lib/p.rb
@@ -0,0 +1,67 @@
+module P
+ class PartialApplier < BasicObject
+ attr_reader :target
+
View a.rb
https://gist.github.com/df9861cc1d105701265df4256c7fd3bb
View gist:5f80459e971eeec0cc4b84038e24df31
Theorem andb_eq_orb :
forall (b c : bool),
b && c = b || c ->
b = c.
Proof.
intros b c.
destruct b.
- simpl.
destruct c.
+ reflexivity.
View competition_actions.ex
defmodule Api.CompetitionActions do
use Api.Web, :action
alias Api.{Competition, TeamActions, Vote, PaperVote, Team}
alias Ecto.{Changeset}
defp _get do
Repo.one(from(c in Competition)) || %Competition{}
end
View competition_actions.ex
defmodule Api.CompetitionActions do
use Api.Web, :action
alias Api.{Competition, TeamActions, Vote, PaperVote, Team}
alias Ecto.{Changeset}
defp _get do
Repo.one(from(c in Competition)) || %Competition{}
end
View -
diff --git a/test/controllers/admin/admin_paper_vote_controller_test.exs b/test/controllers/admin/admin_paper_vote_controller_test.exs
new file mode 100644
index 0000000..f63d82a
--- /dev/null
+++ b/test/controllers/admin/admin_paper_vote_controller_test.exs
@@ -0,0 +1,61 @@
+defmodule Api.Admin.PaperVoteControllerTest do
+ use Api.ConnCase
+
+ alias Api.{CompetitionActions}
View -
execve("/bin/bash", ["bash", "-i", "-c", "echo -n"], [/* 76 vars */]) = 0
brk(NULL) = 0x9b2000
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
mmap(NULL, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ff03c71a000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=118533, ...}) = 0
mmap(NULL, 118533, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7ff03c6fd000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)