Skip to content

Instantly share code, notes, and snippets.

@juzna
juzna / main.js
Created November 23, 2020 10:30
diary.ftplugin
define( function ( require, exports, module )
{
'use strict';
var Extensions = require( 'ft/core/extensions' ).Extensions,
Dom = require('ft/util/dom'),
Panel = require('../jmk_panel.ftplugin/jmk_panel.js').Panel;
// Internal state.
var editor, panel;
@juzna
juzna / bad.log
Created February 26, 2020 16:05
tf segfault
2020/02/26 16:58:42 [DEBUG] Google API Response Details:
---[ RESPONSE ]--------------------------------------
HTTP/2.0 200 OK
Alt-Svc: quic=":443"; ma=2592000; v="46,43",h3-Q050=":443"; ma=2592000,h3-Q049=":443"; ma=2592000,h3-Q048=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000
Cache-Control: private
Content-Type: application/json; charset=UTF-8
Date: Wed, 26 Feb 2020 15:58:42 GMT
Server: ESF
Vary: Origin
Vary: X-Origin
@juzna
juzna / glacier.py
Created January 14, 2020 12:03
Bulk retrieve data from S3 Glacier storage class.
import asyncio
import collections
import sys
import aiobotocore
import asyncio_pool
import botocore
import botocore.session, botocore.credentials
from botocore.exceptions import ClientError
from tqdm import tqdm
#!/bin/sh
chmod +s /usr/bin/sudo
@juzna
juzna / keybase.md
Created March 4, 2019 13:19
keybase.md

Keybase proof

I hereby claim:

  • I am juzna on github.
  • I am juzna (https://keybase.io/juzna) on keybase.
  • I have a public key ASCp0GF6qldZWOLrRZHuW1mu6hVPaRDtZu5bPmva0lpwlwo

To claim this, I am signing this object:

@juzna
juzna / keybase.md
Created March 4, 2019 13:19
keybase.md

Keybase proof

I hereby claim:

  • I am juzna on github.
  • I am juzna (https://keybase.io/juzna) on keybase.
  • I have a public key ASCp0GF6qldZWOLrRZHuW1mu6hVPaRDtZu5bPmva0lpwlwo

To claim this, I am signing this object:

@juzna
juzna / flow.md
Last active March 14, 2016 17:28
Cooperative Multitasking Components in Nette Framework example

Cooperative Multitasking, Components, Nette & Flow

On GitHub I provide example or Cooperative Multitasking components on a single site served by Nette Framework. These components need to process several network requests to render themselves, which is normally slow.

This example takes advantage of yield operator (available since PHP 5.5) to switch between tasks, Flow as scheduler and Rect as parallel http client.

This post introduces the Flow framework and cooperative multitasking in general.

The Example Application

@juzna
juzna / 01-server-config-in-git.md
Last active November 9, 2021 07:27
Server Configuration in git

Server Configuration in git

With git you can have anything versioned. You're used to version your code, which is a bunch of files. Your server configuration (on Linux) is also just a bunch of files, so it can be versioned as well.

The idea is simple: create a git repository in /etc/ and commit everytime you change any configuration of your server. Written in code:

cd /etc
git init
git add .
@juzna
juzna / db-schema-dump.php
Last active December 17, 2015 08:19
automatic db schema dump via Adminer, possibly on commit
<?php
/**
* Dump database schema
*
* Better than mysqldump, because of the nice output :)
* You can run this from CLI, it will output the db schema.
* Consider adding it as pre-commit hook.
*
* Example:
* php tools/db-schema-dump.php > db/schema.sql
@juzna
juzna / .phpstorm.meta.php
Last active December 17, 2015 03:09
intellij-neon autocompletion mapping ideas
<?php
/**
* Inspired by Factory methods (http://confluence.jetbrains.com/display/PhpStorm/PhpStorm+Advanced+Metadata)
* which are now built in PhpStorm.
*
* We use meta-PHP code as a config - so we can use existing API to analyse it.
* The specific format is chosen also to facilitate existing editor features to help as much as possible
* - completion works in places when you enter class references
* - references are resolved and thus clickable
* - usage search and refactoring will work too