Skip to content

Instantly share code, notes, and snippets.

jakub-g jakub-g

Block or report user

Report or block jakub-g

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
jakub-g /
Last active Feb 25, 2020
go to root folder of git repo from a bash script
# first, switch to the directory of where the currently executing script is located
cd "$( dirname "${BASH_SOURCE[0]}" )"
# now, find the git repo root, and switch to that directory
cd "./"$(git rev-parse --show-cdup)
# now, run stuff from the git root
View ip.php
$remote = @$_SERVER['REMOTE_ADDR'];
printf("%s\n", (($name = gethostbyaddr($remote)) !== false) ? $name : $remote);
jakub-g / window proxy.html
Last active Oct 9, 2019
Proxying reads from global variables via ES6 proxy and `with`
View window proxy.html
<!doctype html>
<meta charset="utf-8">
var windowProxy = new Proxy(window, {
get: function(target, propKey, value) {
if (typeof propKey !== 'symbol') {
jakub-g / kibana scripted
Created Jun 25, 2019
kibana adhoc scripted field vs scripted field defined in panel
View kibana scripted

scripted field

if (!doc['data.request_response_time'].empty) {
  return doc['data.request_response_time'].value + doc['data.response_to_boot_start_time'].value + doc['data.boot_def_time'].value + doc['data.dmp_call_time'].value + doc['data.dmp_create_time'].value

return null
jakub-g /
Created May 6, 2019
mkcert for npm's http-server
mkcert -cert-file cert.pem -key-file key.pem "*"
jakub-g /
Last active Feb 6, 2020
navigator.sendBeacon brain dump -- many not so great points

navigator.sendBeacon(url, data)

The data parameter is an ArrayBufferView, Blob, DOMString, or FormData object containing the data to be transmitted.

  • no plain old key-value JS object :| serialization of an object to a string up to the developer

  • always POST, not possible to send GET :|

  • when DOMString passed, the request type is Content-Type: text/plain, hence expressjs middlewares that read postdata won't process it :/ need to write custom middleware

jakub-g /
Last active Apr 12, 2019
Installing old version of Firefox on Windows for testing and preventing it from self-updating
  1. Grab old version of Firefox from Mozilla's FTP. They downloads are placed in folders that follow a simple naming convention. For example v63.0 is here:

  1. Run the installer and install it to a folder like c:\software\firefox63

  2. IMPORTANT: turn off internet connectivity at system level before running Firefox for the first time! Otherwise it will automatically self-update! (Windows 10 has "airplane mode").

  3. Create a shortcut with special command line switches

jakub-g / gist:a826368ac9ec5f82d32f9e2d93ea3a0f
Created Mar 14, 2019
vscode prevent watcher to keep a lock
View gist:a826368ac9ec5f82d32f9e2d93ea3a0f
open .vscode/settings.json
jakub-g /
Created Mar 7, 2019
Accept-language and other sniffings gone bad
jakub-g /
Last active Mar 6, 2019
Screen sharing best practices and tips

When sharing your screen -- during an on-site presentation, a remote meeting presentation, a conference talk -- there are a lot of small things to consider to make the experience better for the viewers. It's paramount to accommodate for the fact that your viewers will perceive things differently from youself due to where they are and their individual predispositions.


  • Make sure your pointer is visible to the users (or accommodate for it if impossible).

    • For example, when sharing mobile screens, people don't see where your finger is. Demos which rely on you tapping the device in places invisible to the observers are bad. Accommodate for that by telling upfront where are you going to tap.
    • When using tools like Vysor, prefer clicking things on your laptop with your mouse, instead of directly tapping with your finger on the device.
  • Make sure people in the room and the ones connected remotely *c

You can’t perform that action at this time.