Skip to content

Instantly share code, notes, and snippets.

View marinakr's full-sized avatar

Maryna Shabalina marinakr

View GitHub Profile
@arsperger
arsperger / redis_import_csv.txt
Created September 12, 2017 11:38
import csv file into redis with a single command
cat data.csv | awk -F',' '{print " SET \""$1"\" \""$2"\" \n"}' | redis-cli --pipe
@xlphs
xlphs / public_key_verify.exs
Created April 5, 2017 17:22
public_key_verify.exs
defmodule PublicKey do
def verify_fun(_, {:extension, _}, state) do
IO.puts "verify_fun -- extension"
{:unknown, state}
end
def verify_fun(_, {:revoked, _}, state) do
IO.puts "verify_fun -- revoked"
{:fail, state}
end
@emilsoman
emilsoman / phoenix_to_umbrella
Last active July 13, 2024 21:50
How to move an existing phoenix app under an umbrella app
How to convert existing phoenix app to an umbrella app.
https://elixir-lang.slack.com/archives/phoenix/p1472921051000134
chrismccord [10:14 PM]
@alanpeabody yes, it's straightforward
[10:14]
1) mix new my_umbrella --umbrella
@gnanet
gnanet / split-pem.sh
Created October 18, 2015 02:42
Split combined PEM file the smart way (tested on debian, requires openssl)
#!/bin/bash
if [ $1 ]
then
if [ -f $1 ]
then
pemfile=$1
fi
else
echo "Usage: split-pem.sh COMBINED-PEMFILE"
@rpt
rpt / partial.erl
Last active May 12, 2017 14:19
Partial function in Erlang, who would have thought?...
-module(partial).
-export([partial/2]).
-export([test/0]).
-spec partial(function(), [term()]) -> function().
partial(Fun, Args) when is_function(Fun), is_list(Args) ->
lists:foldl(fun partial1/2, Fun, Args).