Skip to content

Instantly share code, notes, and snippets.

@simonjohnthompson
simonjohnthompson / Marlowe.hs
Created Sep 17, 2019
Marlowe Smart Contract
View Marlowe.hs
{-# LANGUAGE OverloadedStrings #-}
module Escrow where
import Language.Marlowe
main :: IO ()
main = print . pretty $ contract
{- What does the vanilla contract look like?
@cartyc
cartyc / OPA Gatekeeper Duplicate Ingress
Created Sep 17, 2019
OPA Gatekeeper Duplicate Ingress
View OPA Gatekeeper Duplicate Ingress
apiVersion: templates.gatekeeper.sh/v1alpha1
kind: ConstraintTemplate
metadata:
name: ingressdupes
spec:
crd:
spec:
names:
kind: IngressDupe
listKind: IngressDupeList
View keybase.md

Keybase proof

I hereby claim:

  • I am m14r on github.
  • I am tvaylayt (https://keybase.io/tvaylayt) on keybase.
  • I have a public key ASC53IkBsZFnBTXQQPwaiPQWinGokGyDrBQGlwhA_DiUmwo

To claim this, I am signing this object:

@rust-play
rust-play / playground.rs
Created Sep 17, 2019
Code shared from the Rust Playground
View playground.rs
fn main() {
let raw_vec: *mut Vec<i32>;
{
let mut my_vec = vec![1, 2, 3, 4, 5];
raw_vec = &mut my_vec as *mut Vec<i32>;
}
// Example use of leaked pointer
unsafe { println!("{:?}", *raw_vec); }
}
@rust-play
rust-play / playground.rs
Created Sep 17, 2019
Code shared from the Rust Playground
View playground.rs
fn main() {
let raw_vec: *mut Vec<i32>;
{
let mut my_vec = vec![1, 2, 3, 4, 5];
raw_vec = &mut my_vec as *mut Vec<i32>;
}
// Example use of leaked pointer
unsafe { println!("{:?}", *raw_vec); }
}
@guiqide
guiqide / js-template.js
Created Sep 17, 2019
正则实现js模板引擎
View js-template.js
// 别看这个模板引擎代码很少,但是活用了正则、将字符串转为可以行代码两个知识点
const a = {
a: 1,
b: {
c: 2,
e: ['Array']
}
}
const tpl = `你好{{ a ? '真' : '假'}}
@rust-play
rust-play / playground.rs
Created Sep 17, 2019
Code shared from the Rust Playground
View playground.rs
fn main() {
let raw_vec: *mut Vec<i32>;
{
let mut my_vec = vec![1, 2, 3, 4, 5];
raw_vec = &mut my_vec as *mut Vec<i32>;
}
// Example use of leaked pointer
unsafe { println!("{:?}", *raw_vec); }
}
View gist:8b7507b3b413465869a84132c8dd066d
{
"body": {
"key": {
"eldest_kid": "0120ab8b00885054def080667a14bdeb24f0f79c9b717341c9cdf97b4268950210700a",
"host": "keybase.io",
"kid": "0120ab8b00885054def080667a14bdeb24f0f79c9b717341c9cdf97b4268950210700a",
"uid": "d2b4764a27120fb2df5785759f0cc119",
"username": "promickey"
},
"merkle_root": {
@rust-play
rust-play / playground.rs
Created Sep 17, 2019
Code shared from the Rust Playground
View playground.rs
fn main() {
let raw_vec: *mut Vec<i32>;
{
let mut my_vec = vec![1, 2, 3, 4, 5];
raw_vec = &mut my_vec as *mut Vec<i32>;
}
// Example use of leaked pointer
unsafe { println!("{:?}", *raw_vec); }
}
You can’t perform that action at this time.