Skip to content

Instantly share code, notes, and snippets.

luben karavelov luben

  • dublin, ireland
Block or report user

Report or block luben

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@luben
luben / naive-streams.rs
Last active Feb 21, 2019
Naive streams
View naive-streams.rs
#[derive(Clone)]
struct Repeat {
current: u32,
end: u32,
}
impl Repeat {
fn new(current: u32, end: u32) -> Self {
Repeat {current, end}
@luben
luben / AkkaLeak.scala
Last active Apr 24, 2018
Akka-Artery-TCP-leak.scala
View AkkaLeak.scala
import com.typesafe.config._
import akka.actor._
import scala.util.Random
sealed trait Msg;
case object Ping extends Msg;
case object Pong extends Msg;
case object Leak extends Msg;
class ServerActor extends Actor {
View poc.rs
use std::slice::Iter;
use std::ops::{Add, Mul, Neg};
use std::borrow::Cow;
use std::fmt::Debug;
use std::rc::Rc;
/// Our string type is copy-on-write string refs
type Str<'a> = Cow<'a, str>;
/// Marker trait for the values
View RLS.sql
CREATE OR REPLACE FUNCTION set_foo(foo_val varchar) RETURNS void AS $$
BEGIN
EXECUTE format('SET SESSION my.foo TO %I', foo_val) ;
END;
$$ LANGUAGE plpgsql;
CREATE OR REPLACE FUNCTION get_foo() RETURNS varchar AS $$
DECLARE
foo_val varchar;
BEGIN
You can’t perform that action at this time.