Skip to content

Instantly share code, notes, and snippets.

cuchac / memcache_dump_lru_crawler_metadump.php
Last active April 12, 2021 05:45
Dump all memcached keys using `lru_crawler metadump all`
View memcache_dump_lru_crawler_metadump.php
function getAllKeys(\Memcached $mc): array
$allKeys = [];
foreach ($mc->getServerList() as $id => $server) {
$sock = fsockopen($server['host'], $server['port'], $errno, $errstr, 1);
cuchac / Dockerfile
Last active March 25, 2021 12:47 — forked from skurfuerst/
GitLab and Rancher 2 Authentication Proxy
View Dockerfile
FROM golang:1.14 AS builder
WORKDIR /go/src/app
COPY . .
RUN sh
FROM alpine:latest
RUN apk --no-cache add ca-certificates
cuchac / CzechBankAccountCheck.js
Created March 5, 2019 07:36
Czech bank account number validity check / Kontrola validnosti českého čísla účtu
View CzechBankAccountCheck.js
function checkBankAccountNumber(account) {
var matches = /^(([0-9]{0,6})-)?([0-9]{1,10})\/([0-9]{1,6})$/.exec(account);
if (!matches) {
return false;
return checkDigit11(matches[2]) && checkDigit11(matches[3]);
View example.html
<!DOCTYPE html>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<style type="text/css" media="all">
cuchac / Debug smarty with firebug
Created September 2, 2014 08:10 — forked from gtraxx/Debug smarty with firebug
Shows all Smarty variables in tree-view directly in console. Always available and easy to access
View Debug smarty with firebug
{* Smarty *}
{capture name='_smarty_debug' assign=debug_output}
<script type="text/javascript">
// <![CDATA[
window.smarty ={};
{if $assigned_vars != null}
{foreach $assigned_vars as $vars}
window.smarty['{$vars@key|escape:'javascript'}'] = {$vars|@json_encode nofilter};