Skip to content

Instantly share code, notes, and snippets.

@juzna
juzna / main.js
Created Nov 23, 2020
diary.ftplugin
View main.js
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 Feb 26, 2020
tf segfault
View bad.log
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 Jan 14, 2020
Bulk retrieve data from S3 Glacier storage class.
View glacier.py
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
View 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:

View 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 Mar 14, 2016
Cooperative Multitasking Components in Nette Framework example
View flow.md

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 Nov 9, 2021
Server Configuration in git
View 01-server-config-in-git.md

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 Dec 17, 2015
automatic db schema dump via Adminer, possibly on commit
View db-schema-dump.php
<?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 Dec 17, 2015
intellij-neon autocompletion mapping ideas
View .phpstorm.meta.php
<?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