Skip to content

Instantly share code, notes, and snippets.

View jarek-przygodzki's full-sized avatar

Jarek Przygódzki jarek-przygodzki

View GitHub Profile
@jarek-przygodzki
jarek-przygodzki / gist:ccf3b6365322565a3dac
Created March 6, 2016 21:45 — forked from etorreborre/gist:1371518
Tagged Epochtime and Daytime
package object time {
// Unboxed newtypes, credit to @milessabin and @retronym
type Tagged[U] = { type Tag = U }
type @@[T, U] = T with Tagged[U]
class Tagger[U] { def apply[T](t : T) : T @@ U = t.asInstanceOf[T @@ U] }
def tag[U] = new Tagger[U]
trait Day
import java.io._
import java.net._
object Main {
trait StreamTypeInferencer[A, B]
object StreamTypeInferencer {
implicit object InputStreamInputStream
extends StreamTypeInferencer[InputStream, InputStream]
implicit object InputStreamBufferedInputStream
extends StreamTypeInferencer[BufferedInputStream, InputStream]
@jarek-przygodzki
jarek-przygodzki / play.scala
Created September 18, 2016 14:00 — forked from lihaoyi/play.scala
play.scala
/**
* Single-file play framework application! Make sure everything
* works, as this is the test case that un-earthed #371
*/
load.ivy("com.typesafe.play" %% "play" % "2.5.0")
load.ivy("com.typesafe.play" %% "play-netty-server" % "2.5.0")
load.ivy("org.scalaj" %% "scalaj-http" % "2.2.1")
@
@jarek-przygodzki
jarek-przygodzki / Oracle delete all tables in schema.sql
Created November 14, 2016 08:26 — forked from jzi96/Oracle delete all tables in schema.sql
Oracle delete all tables in schema (data)
SET SERVEROUTPUT ON
exec dbms_output.enable(1000000);
DECLARE
v_typ VARCHAR2(32);
v_name VARCHAR2(32);
v_constraint VARCHAR2(32);
v_sql VARCHAR2(100);
CURSOR c_objekte IS
SELECT typ, NAME
@jarek-przygodzki
jarek-przygodzki / associate_sde_stats.sql
Created November 14, 2016 08:26 — forked from kbaesler/associate_sde_stats.sql
Oracle 11g: The post scripts that should be run after refreshing a geodatabase instance.
EXECUTE sys.utl_recomp.recomp_serial('SDE');
ASSOCIATE STATISTICS WITH PACKAGES sde.st_domain_operators, sde.st_relation_operators USING sde.st_domain_stats;
ASSOCIATE STATISTICS WITH INDEXTYPES sde.st_spatial_index USING sde.st_domain_stats;
ASSOCIATE STATISTICS WITH TYPES sde.st_geometry USING sde.st_domain_stats;
@jarek-przygodzki
jarek-przygodzki / rtfm.md
Created January 11, 2017 11:57 — forked from rbowen/rtfm.md
Read The F* Manual? Write a better f* manual.

Definition: RTFM - Read The F'ing Manual. Occasionally it is ironically rendered as Read The Fine Manual. A phrase uttered at people who have asked a question that we, the enlightened, feel is beneath our dignity to answer, but not beneath our dignity to use as an opportunity to squish a newbie's ego.

Have you noticed that the more frequently a particular open source community tells you to RTFM, the worse the FM is likely to be? I've been contemplating this for years, and have concluded that this is because patience and empathy are the basis of good documentation, much as they are the basis for being a decent person.

First, some disclaimers.

Although I've been doing open source documentation for almost 20 years, I have no actual training. There are some people that do, and there are some amazing books out there that you should read if you care about this stuff.

First, I'd recommend [Conversation and Community](http://www.amazon.com/Conversation-Community-Social-Web-Documentation-ebook/dp/B00C7CC

@jarek-przygodzki
jarek-przygodzki / cleanupManifestsWithoutTags.sh
Created July 31, 2017 06:35 — forked from mortensteenrasmussen/cleanupManifestsWithoutTags.sh
Clean up untagged manifests in private docker registry
#!/bin/bash
REGISTRY_DIR=YOUR_REGISTRY_DIR/data/docker/registry/v2/repositories
REGISTRY_URL=http://10.10.10.10:5000
#add --insecure to the curl command on line 17 if you use https with self-signed certificates
cd ${REGISTRY_DIR}
count=0
manifests_without_tags=$(comm -23 <(find . -type f -name "link" | grep "_manifests/revisions/sha256" | grep -v "\/signatures\/sha256\/" | awk -F/ '{print $(NF-1)}' | sort) <(for f in $(find . -type f -name "link" | grep "_manifests/tags/.*/current/link"); do cat ${f} | sed 's/^sha256://g'; echo; done | sort))
@jarek-przygodzki
jarek-przygodzki / git-dirty-checks.md
Created March 4, 2018 20:16 — forked from sindresorhus/git-dirty-checks.md
Benchmark results of the fastest way to check if a git branch is dirty

Tested against the WebKit git repo by entering the repo with 1 file dirty.


git diff --quiet --ignore-submodules HEAD # Will tell if there are any uncomitted changes, staged or not.
0.6 sec

git diff-index --quiet HEAD # Only tracked
2 sec

@jarek-przygodzki
jarek-przygodzki / check_fdb.py
Created March 6, 2018 07:54 — forked from kleptog/check_fdb.py
Script to check Docker Swarm fdb
#!/usr/bin/python
from subprocess import check_output as run
import glob
# Get nodes
nodes = run(['docker', 'node', 'ls', '-q']).split()
self = run(['docker', 'node', 'inspect', 'self', '--format={{.ID}}']).strip()
nodeinfo = {}
= Arch Linux step-by-step installation =
= http://blog.fabio.mancinelli.me/2012/12/28/Arch_Linux_on_BTRFS.html =
== Boot the installation CD ==
== Create partition ==
cfdisk /dev/sda
* Create a partition with code 8300 (Linux)