Skip to content

Instantly share code, notes, and snippets.

--
-- Created by IntelliJ IDEA.
-- User: jackisback
-- Date: 15/04/2021
-- Time: 23.20
-- To change this template use File | Settings | File Templates.
--
-- Reference:
-- https://github.com/openresty/lua-nginx-module#data-sharing-within-an-nginx-worker
-- This module needs to be loaded by the `require()` builtin like this:
```shell script
$ bumpversion --current-version 1.0.0 minor setup.py
$ rm -rf {build,dist}/* && python setup.py sdist bdist_wheel
$ twine check dist/*
$ twine upload dist/*
```
@adamjakab
adamjakab / InstallEssentiaEnvironment.txt
Last active March 12, 2020 17:51
Setup Essentia + Gaia environment on MacOS 13
# GAIA:
# https://github.com/MTG/gaia/blob/master/README.md
# ESSENTIA:
# https://github.com/MTG/homebrew-essentia
# https://essentia.upf.edu/installing.html
# Will create `Brewfile` wil all currently installed taps and packages
# After this process wou might want to use it it reinstall what was already there before
@adamjakab
adamjakab / sync-to-wdcloud.sh
Created January 23, 2018 09:25
RSYNC TO NAS
#!/bin/bash
#PATHS
RSYNC="/usr/bin/rsync"
SRC="/mnt/storage/data/FOLDER_TO_BACKUP" # !!!NO TRAILING SLASH PLEASE!!!
DST="/mnt/autofs/WD-BACKUP-RW/AdamJakab/FOLDER_TO_BACKUP" # !!!NO TRAILING SLASH PLEASE!!!
# SET UP VARIABLES FOR CP
RSYNC_PATH_SRC="${SRC}/"
RSYNC_PATH_DST="${DST}/"
@adamjakab
adamjakab / UserProfileForm.php
Created March 6, 2017 14:59
form #submit with static class method reference
<?php
/**
* Created by Adam Jakab.
* Date: 06/03/17
* Time: 12.43
*/
namespace Agora\Alter\Form\Id;
use Mekit\Drupal7\HookInterface;
@adamjakab
adamjakab / controller.php
Created June 16, 2016 12:20
fixed AOR_Reports - addToProspectLists
/**
* Add beans to prospect list
*/
protected function action_addToProspectList() {
global $beanList;
$answer = [
'STATUS' => 'UNKNOWN',
'ERRORS' => [],
'REQUEST' => $_REQUEST,
];
@adamjakab
adamjakab / mekit_barcode_feeds_processor.module
Created May 27, 2016 06:48
basic implementatio to handle barcode_field in feeds module
<?php
/**
* Enable barcode field handling for Feeds
*
* Implements hook_feeds_processor_targets_alter().
* @param array &$targets
* Array containing the targets to be offered to the user. Add to this array
* to expose additional options.
<?php
require_once 'include/utils/progress_bar_utils.php';
/**
* Class progress_bar_utilsTest
*/
class progress_bar_utilsTest extends PHPUnit_Framework_TestCase
{
public function testprogress_bar_flush()
@adamjakab
adamjakab / mailtest.php
Created March 30, 2016 15:16
stream_socket_client tests for palin and ssl resources
<?php
error_reporting(E_ALL);
ini_set("display_errors",1 );
$socket_context = stream_context_create([]);
$timeout = 30;
$errno = 0;
$errstr = '';
@adamjakab
adamjakab / ckeditor.inc
Created December 9, 2015 14:48
WYSIWYG - fix CKEditor version(4+) check
if (preg_match('@version:[\'"](?:CKEditor )?([\d\.]+)(?:.+revision:[\'"]([\d]+))?@', $line, $version)) {