Skip to content

Instantly share code, notes, and snippets.

View Juszczak's full-sized avatar

Adrian Juszczak Juszczak

View GitHub Profile
@Juszczak
Juszczak / compile.sh
Created March 22, 2018 11:55
MacOS LockScreen Util
clang -framework Foundation lock.m -o lock
@Juszczak
Juszczak / fast-ip.sh
Created March 20, 2018 14:25
Fast IP info by greping ifconfig for local and DNS lookup for global (used as tmux plugin)
#!/usr/bin/env bash
declare glob; glob="$(dig +short myip.opendns.com @resolver1.opendns.com)";
declare local; local="$(ifconfig en4 | grep 'inet ' | awk '{print $2}')"
declare out; out="$local | $glob"
echo "$out"
@Juszczak
Juszczak / TrueColour.md
Created February 6, 2018 20:17 — forked from XVilka/TrueColour.md
True Colour (16 million colours) support in various terminal applications and terminals

Colours in terminal

It's a common confusion about terminal colours... Actually we have this:

  • plain ascii
  • ansi escape codes (16 colour codes with bold/italic and background)
  • 256 colour palette (216 colours + 16 ansi + 24 gray) (colors are 24bit)
  • 24bit true colour ("888" colours (aka 16 milion))
printf "\x1b[${bg};2;${red};${green};${blue}m\n"
@Juszczak
Juszczak / angular.html
Created January 25, 2018 22:31
AngularJS witch dependencies from Google CDN
<!-- angular -->
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular.min.js"></script>
<!-- angular material styles -->
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/angular_material/1.1.0/angular-material.min.css">
<!-- angular material dependencies -->
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular-animate.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular-aria.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular-messages.min.js"></script>
@Juszczak
Juszczak / watcher.sh
Created January 13, 2018 11:46
Fix FS Watcher on Ubuntu
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf ; sudo sysctl -p
@Juszczak
Juszczak / get_buffers_number.vim
Created September 7, 2017 14:55
Returns number of buffers in Vim
function! GetBuffersNumber()
return len(filter(range(1, bufnr('$')), 'buflisted(v:val)'))
endfunction
@Juszczak
Juszczak / KeyCodes.ts
Created July 21, 2017 08:28
KeyboardEvent key codes enum
export enum KeyCodes {
Backspace = 8,
Tab = 9,
Enter = 13,
Shift = 16,
Ctrl = 17,
Alt = 18,
PauseBreak = 19,
CapsLock = 20,
Escape = 27,
@Juszczak
Juszczak / converter.js
Last active June 1, 2017 13:30
dirty `.json` <-> `.properties` converter
const fs = require('fs')
const path = require('path')
const PROPS_DELIMITER = '='
const readJSON = fileName => JSON.parse(fs.readFileSync(path.resolve(process.cwd(), fileName), 'utf8'))
const toJSON = data => {
const output = {}
data.split('\n')
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v2
mQINBFicbNQBEADiIkNXvo26KhTKVfwiby+THPQRvaFYT6WN+zqc3/bAe8bYXGDV
AxRvdE1+2rjgtiUHFUEZ41CuMrS2W142kDVnY9RjbxBVw1Q2W+h+y+5UT21Xqtoi
RTV64mXYkRUpnmV7dWco6g+gO+imPNHR0bBlBDWrMtq5PNq40h5sRQmF/v9x8Pe3
8aWyFfmtRsV1lqRavkt/GwLoxyCDxdEKemApwjHanKw/Yu9g71tE8icwnYy1u8cn
86nw9y04K1AY93pgxu3XR80nWICs4D0rfPDH2SG9b86TIgENNXZBvrLTzRaRwN5l
aCmRR5NcLJcoZH7ydeZMOhX45irnnmEzmYlSKO7oLB0MFgXjFw8bQ9lmQ/gNnZr3
rH9BnTX4Sx2EGyL9tzO3+4DXuEmzaW8hN4+dNupoDSO5gfL3JmnPVYEhAeN5HBLR

Keybase proof

I hereby claim:

  • I am juszczak on github.
  • I am juszczak (https://keybase.io/juszczak) on keybase.
  • I have a public key ASDhgxSrsMgfIAUaa-q2s4hD_gtMUWmdOyo3lNlv9-a2zQo

To claim this, I am signing this object: