Skip to content

Instantly share code, notes, and snippets.

View egze's full-sized avatar

Aleksandr Lossenko egze

View GitHub Profile
@raorao
raorao / ets_cache.ex
Last active May 7, 2024 11:15
Simple ETS based cache with TTL
defmodule RequestCache do
@moduledoc """
Simple ETS-based cache.
"""
use GenServer
@type t :: %{ttl: integer, invalidators: %{}}
@type cache_key :: any
@type cache_value :: any
@mks-m
mks-m / tiny_redis.rb
Last active April 7, 2021 16:47
tiny_redis_client.rb
# Copyright 2017 Maksym Melnychok
# MIT License - https://opensource.org/licenses/MIT
#
# inspired by https://github.com/ptrofimov/tinyredisclient
require 'socket'
class TinyRedis
RN = "\r\n"
@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#