Skip to content

Instantly share code, notes, and snippets.

View huitseeker's full-sized avatar

François Garillot huitseeker

View GitHub Profile
@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 {
@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 {
<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>
@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
@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")
package net.atos.sparti.pub
import java.io.PrintStream
import java.net.Socket
import org.apache.commons.pool2.impl.{DefaultPooledObject, GenericObjectPool}
import org.apache.commons.pool2.{ObjectPool, PooledObject, BasePooledObjectFactory}
import org.apache.spark.streaming.dstream.DStream
class PooledSocketStreamPublisher[T](host: String, port: Int)
@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
@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 {
@paulp
paulp / The Signs of Soundness
Last active June 17, 2021 06:48
The Signs of Soundness
Hello scala, my old friend
I've come to take you home again
Because a feature slowly creeping
left me plagued with doubts and weeping
and the version that was tagged in the repo
just has to go
it lacks the signs of soundness
On sleepless nights I hacked alone
applying ant and other tools of stone
@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