Skip to content

Instantly share code, notes, and snippets.

View mikz's full-sized avatar

Michal Cichra mikz

View GitHub Profile
@mikz
mikz / luarocks.rb
Created August 21, 2016 12:26
LuaRocks Homebrew Formula
require 'formula'
class Luarocks < Formula
homepage 'https://rocks.moonscript.org/'
stable do
url 'https://github.com/keplerproject/luarocks/archive/v2.3.0.tar.gz'
sha256 '92c014889ec6a09c4bb492df6b7f7be784110d6abe031e16418342781ca5c5ce'
end
@mikz
mikz / jspm.rb
Created June 17, 2016 09:34
detect jspm packages licenses
#!/usr/bin/env ruby
require 'open-uri'
require 'json'
require 'shellwords'
ENV['NODE_PATH'] = '/usr/local/lib/node_modules'
# npm install -g licenses

Minimum Viable Async with Node 6

With the release of Node 6.0.0, the surface of code that needs transpilation to use ES6 features has been reduced very dramatically.

This is what my current workflow looks like to set up a minimalistic and fast microservice using micro and async + await.

The promise

@anynoomcz
anynoomcz / Stručná historie přípravy systému EET.md
Last active April 8, 2016 23:33
Jak v roce 2015 probíhala příprava implementace systému EET

Stručná historie dodávky systému EET

Plány Ministerstva financí

Během roku 2015 probíhaly nezanedbatelné aktivity v oblasti EET tak, jak je MF na počátku roku předestřelo v tiskové zprávě.

Průzkum trhu

Dle uvedeného plánu SPCSS (Státní pokladna Centrum sdílených služeb) uspořádalo průzkum trhu, který byl podkladem pro zúžení skupiny oslovených potenciálních dodavatelů, kde základním kvalifikačním předpokladem byla schopnost zpracovávat nabídku a následně dodávat systém v režimu utajených informací.

@rezan
rezan / s3.vcl
Last active July 6, 2023 13:02
Varnish AWS S3 Gateway VCL
#
# Varnish AWS S3 Gateway VCL
#
# Allows global read (GET, HEAD) and ACL protected writes (POST, PUT, DELETE).
# When writing, pass in Content-Type and Content-MD5, both are optional.
#
# Params:
#
# %BUCKET% - S3 bucket name, S3 host may be regional
# %ACCESS_ID% - IAM access ID for bucket
@paoloantinori
paoloantinori / keycloak.sh
Created January 26, 2016 15:59
Keycloak Admin API Rest Example
#!/bin/bash
export TKN=$(curl -X POST 'http://localhost:8080/auth/realms/master/protocol/openid-connect/token' \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "username=admin" \
-d 'password=admin' \
-d 'grant_type=password' \
-d 'client_id=admin-cli' | jq -r '.access_token')
curl -X GET 'http://localhost:8080/auth/admin/realms' \
@calio
calio / clock_gettime
Last active January 11, 2018 13:15
clock_gettime() via LuaJIT + FFI
local ffi = require("ffi")
ffi.cdef[[
typedef long time_t;
typedef int clockid_t;
typedef struct timespec {
time_t tv_sec; /* seconds */
long tv_nsec; /* nanoseconds */
} nanotime;
@jcieslar
jcieslar / selectize_spec.rb
Created March 19, 2015 16:33
Capybara and selectize
page.execute_script("$('.selectize-input input').val('ber')")
sleep 0.5
page.execute_script("$('.selectize-input input').keyup()")
sleep 0.5
page.execute_script("$('.full-name').mousedown()")
# https://github.com/brianreavis/selectize.js/blob/master/src/selectize.js
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.
@chsh
chsh / pg_pub_sub.rb
Last active May 2, 2024 08:13
PostgreSQL LISTEN/NOTIFY example for ruby
#
# A:
# pubsub = PgPubSub.new('channelname')
# pubsub.subscribe do |data|
# puts "data: #{data} is coming!"
# end
#
# B:
# pubsub = PgPubSub.new('channelname')
# pubsub.publish("hello world")