Skip to content

Instantly share code, notes, and snippets.

View naartjie's full-sized avatar

Marcin Jekot naartjie

View GitHub Profile
@naartjie
naartjie / flush dns cache
Last active August 29, 2015 14:05
OSX command-line
dscacheutil -flushcache
@naartjie
naartjie / find + xargs
Last active August 29, 2015 14:05
find / xargs for files containing spaces
find -print0 | xargs -0 cmd
@naartjie
naartjie / csr.sh
Created September 1, 2014 09:05
Generate CSR
openssl req -new -newkey rsa:2048 -nodes -keyout <domain>.key -out <domain>.csr
@naartjie
naartjie / git_stuffs.sh
Last active August 29, 2015 14:07
git delete remote branch
git push origin :branch_name
@naartjie
naartjie / lodash-mixin.js
Last active August 29, 2015 14:08
lodash compactObject mixin
'use strict';
var _ = require('lodash');
_.mixin({compactObject: _.partialRight(_.pick, _.identity)});
@naartjie
naartjie / centering-in-the-unknown.css
Last active September 3, 2015 08:34
Centering / Positioning in CSS
/* http://css-tricks.com/centering-in-the-unknown/ */
/* This parent can be any width and height */
.block {
text-align: center;
}
/* The ghost, nudged to maintain perfect centering */
.block:before {
content: '';
@naartjie
naartjie / DNS cache
Last active September 7, 2018 01:19 — forked from lithuak/gist:7294386
Chrome
chrome://net-internals/#dns
db.users.aggregate(
{ $group : {_id : "$msisdn", total : { $sum : 1 } } },
{ $match : { total : { $gte : 2 } } },
{ $sort : {total : -1} }
);
db.places.aggregate(
{ $group : {_id : "$extra_info.id", total : { $sum : 1 } } },
{ $match : { total : { $gte : 2 } } },
@naartjie
naartjie / jquery_version.js
Last active August 29, 2015 14:10
hey, which version of jQuery am I running?
(typeof jQuery === "undefined" ? $ : jQuery).fn.jquery
require "formula"
class Luarocks < Formula
homepage "http://luarocks.org"
url "http://luarocks.org/releases/luarocks-2.2.0.tar.gz"
sha1 "e2de00f070d66880f3766173019c53a23229193d"
revision 1
bottle do
sha1 "eabd3d0f2bb7979ac831ce948e8d288569d2a0c8" => :mavericks