Skip to content

Instantly share code, notes, and snippets.

View huitseeker's full-sized avatar

François Garillot huitseeker

View GitHub Profile
@jasonreich
jasonreich / Jigger.agda
Created December 12, 2010 19:14
A variant on Conor McBride's trick
-- Forked from http://personal.cis.strath.ac.uk/~conor/fooling/Jigger.agda
module Jigger where
data Nat : Set where
zero : Nat
suc : Nat -> Nat
_+_ : Nat -> Nat -> Nat
zero + n = n
suc m + n = suc (m + n)
@a2ikm
a2ikm / README.md
Last active February 3, 2017 19:52
lsyncdとserfでS3を介してファイルを同期するようなやつ

lsyncdとserfでS3を介してファイルを同期するようなやつ

master側の/path/to/shared以下でファイルの変更が検知されたら、lsyncdがS3に同期をかけ、そののちserfクラスタにupdateイベントを発行する。 それを受け取ったslave側がS3からファイルを持ってくる。

Requirements

  • lsyncd
  • serf
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
#include <iostream>
#include <type_traits>
#include <string>
// primality test
template<int N, int M>
struct divides
{
enum { value = ((N%M) == 0) || divides<N, M-1>::value };
@paulp
paulp / global.sbt
Last active October 16, 2018 19:09
continuous compilation of the sbt build
// These lines go in ~/.sbt/0.13/global.sbt
watchSources ++= (
(baseDirectory.value * "*.sbt").get
++ (baseDirectory.value / "project" * "*.scala").get
++ (baseDirectory.value / "project" * "*.sbt").get
)
addCommandAlias("rtu", "; reload ; test:update")
addCommandAlias("rtc", "; reload ; test:compile")
addCommandAlias("ru", "; reload ; update")
@rust-play
rust-play / playground.rs
Created October 3, 2019 19:12
Code shared from the Rust Playground
fn main() {
let mut last_commit_hash = HashValue::zero(); // Genesis hash
let mut last_commit_round = 0;
fn get_and_check(untrusted_store: BlockStore, hash: HashValue) -> Result<Block, Error> {
let block_candidate = untrusted_store
.get(hash)
.ok_or(format_err!("Block store is incomplete, lacks {}", hash))?;
// this calls BlockHasher::hash()
if block_candidate.hash() == hash {
@rust-play
rust-play / playground.rs
Created October 3, 2019 19:22
Code shared from the Rust Playground
fn main() {
let mut last_commit_hash = HashValue::zero(); // Genesis hash
let mut last_commit_round = 0;
fn get_and_check(untrusted_store: BlockStore, hash: HashValue) -> Result<Block, Error> {
let block_candidate = untrusted_store
.get(hash)
.ok_or(format_err!("Block store is incomplete, lacks {}", hash))?;
// this calls BlockHasher::hash()
if block_candidate.hash() == hash {
@ymasory
ymasory / bay-scala-jobs
Last active February 18, 2020 20:48
Companies hiring Scala developers in the Bay Area.
Companies hiring Scala developers in the Bay Area.
Created in response to a thread on scala-base.
My favorites:
- CloudPhysics
- Wordnik
Unbiased list:
- 10Gen
- Audax Health
@a2ikm
a2ikm / lsyncd.conf.lua
Last active September 7, 2020 11:06
lsyncd + s3
s3sync = {
maxProcesses = 1,
onStartup = "aws s3 sync ^source ^target",
onCreate = "[ -f ^source^pathname ] && aws s3 cp ^source^pathname ^target^pathname || true",
onModify = "[ -f ^source^pathname ] && aws s3 cp ^source^pathname ^target^pathname || true",
onDelete = "[ -f ^source^pathname ] && aws s3 rm ^target^pathname || true",
onMove = "aws s3 mv ^target^o.pathname ^target^d.pathname",
}
sync {
@jessfraz
jessfraz / proposal.md
Created February 3, 2017 00:09
High-Level Security Profile Generator

High-Level Security Profile Generator

(originally from my proposal on moby/moby#17142 (comment) but generic)

The profile would generate artificats of an apparmor profile and seccomp filters.

Obviously doesn't have to be toml since that's super hipster :p

Assumptions

  • no one is going to sit and write out all the syscalls/capabilities their app needs
  • automatic profiling would be super cool but like aa-genprof it is never