This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Buffer | |
{ | |
public $data = ''; | |
public $end = FALSE; | |
} | |
class Loop | |
{ | |
public $readStreams = []; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @param string $file | |
* @param callable $tryLoad (string $file, mixed & $data): bool | |
* @param callable $isExpired (string $file): bool | |
* @param callable $fallback (string $file): string | |
* @return mixed | |
*/ | |
function loadCacheFile($file, $tryLoad, $isExpired, $fallback) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"methodCalls": [ | |
{ | |
"class": "\\Mockery", | |
"method": "mock", | |
"position": 0, | |
"mask": "\\Mockery\\MockInterface|%s" | |
}, | |
{ | |
"class": "\\Nette\\DI\\Container", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Nette\Templates; | |
use Nette; | |
use Nette\String; | |
use Nette\Forms\Form; | |
/** | |
* Form macros | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -o errexit -o pipefail -o nounset | |
IFS=$'\n\t' | |
ROOT_CRT="$(dirname $0)/root/root.crt" | |
CA_BUNDLE="$(dirname $0)/ca-bundle.pem" | |
echo -n "Downloading CA bundle... " | |
wget -q -O "$CA_BUNDLE" https://curl.haxx.se/ca/cacert.pem | |
echo "done" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
current_branch="$(git symbolic-ref HEAD 2>/dev/null)" || current_branch="(unknown)" | |
current_branch=${current_branch##refs/heads/} | |
github_username="JanTvrdik" | |
github_token="..." | |
if [[ $current_branch = "(unknown)" ]] | |
then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DELIMITER ;; | |
DROP PROCEDURE IF EXISTS `normalize_foreign_key_name`;; | |
CREATE PROCEDURE `normalize_foreign_key_name`(IN `param_database_name` varchar(100) CHARACTER SET 'ascii', IN `param_table_name` varchar(100) CHARACTER SET 'ascii', IN `param_column_name` varchar(100) CHARACTER SET 'ascii') | |
BEGIN | |
DECLARE var_constraint_name_current VARCHAR(100); | |
DECLARE var_constraint_name_new VARCHAR(100); | |
DECLARE var_constraint_target_table VARCHAR(100); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"bold_folder_labels": true, | |
"close_windows_when_empty": true, | |
"color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme", | |
"default_line_ending": "unix", | |
"enable_tab_scrolling": false, | |
"ensure_newline_at_eof_on_save": true, | |
"fallback_encoding": "Central European (Windows 1250)", | |
"font_face": "Consolas", | |
"font_size": 12, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
read oldrev newrev refname | |
branch=${refname##refs/heads/} | |
if [[ $branch = "master" || $branch = "stage" ]] | |
then | |
echo "Deploying branch $branch..." | |
targetDir="$PWD/../deployed-$branch" | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
/** | |
* @author Chamurappi | |
* @param {DOMElement} element | |
* @return {function()} callback for restoring saved position | |
*/ | |
function savePosition(element) | |
{ | |
if (!element.getBoundingClientRect) return function(){}; | |
var top = element.getBoundingClientRect().top; |