View disable-snapd.sh
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 | |
systemctl stop snapd && systemctl disable snapd && systemctl mask snapd && \ | |
apt purge snapd -y && \ | |
rm -fr ~/snap /snap /var/snap /var/lib/snapd /var/cache/snapd /usr/lib/snapd |
View create-swap.sh
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 | |
SIZE="$1" | |
FILE="/var/swap.img" | |
SWPS=10 | |
CHPR=50 | |
if [ -z "$SIZE" ]; then | |
echo "first argument must be size (fallocate -l)" | |
exit |
View gitpub.php
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 | |
/** | |
* Script for bumping semantic versioned packages to git remote | |
* | |
* @version 0.1.0 | |
* @author Lajos Bencz <lazos@lazos.me> | |
* @license MIT | |
*/ | |
if (!is_dir('.git')) { |
View PhalconRedisAdapter.php
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
use Phalcon\Session\AdapterInterface; | |
use Phalcon\Cache\Backend\Redis as RedisCache; | |
use Phalcon\Cache\Frontend\None as FrontendNone; | |
class Redis implements \SessionHandlerInterface, AdapterInterface | |
{ | |
const SESSION_ACTIVE = 2; | |
const SESSION_NONE = 1; |
View amdgpu-pro-wizard.sh
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 | |
# amdgpu-pro-wizard.sh | |
# Downloads and installs latest AMDGPU-PRO drivers from the official AMD website | |
URL="http://support.amd.com/en-us/kb-articles/Pages/AMDGPU-PRO-Driver-for-Linux-Release-Notes.aspx" | |
DIR="/tmp/.amdgpu-pro-install-9811a15y85p71m/" | |
HTML="list.html" | |
PAT="www2.ati.com/drivers/linux" | |
REF="http://support.amd.com" |
View ProgressBar.php
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 ProgressBar | |
{ | |
const NL = PHP_EOL; | |
/** Pattern used to match placeholders in message formats */ | |
const PATTERN_FORMAT = "/%(?'name'[^\\s%:]+)(:(?'format'[^%]+))?%/"; | |
/** Default format for progress update message */ |
View js-delegates.html
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
<html> | |
<head> | |
<script src="https://code.jquery.com/jquery-2.2.2.min.js" integrity="sha256-36cp2Co+/62rEAAYHLmRCPIych47CvdM+uTBJwSzWjI=" crossorigin="anonymous"></script> | |
<script> | |
$(function(){ | |
$('#add_default').click(function(){ | |
$('#list').append($('<li><a>Default</a></li>')); | |
}); | |
$('#add_clickable').click(function(){ | |
$('#list').append($('<li><a class="clickme">Clickable</a></li>')); |
View TaskInterface.php
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 | |
interface TaskInterface | |
{ | |
/** | |
* Assign the first number | |
* @param int $value | |
* @return $this | |
*/ | |
public function setA($value); |
View ConvertByteSize.php
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 LajosBencz; | |
class ConvertByteSize | |
{ | |
const FORMAT_BYTE_SIZE_PATTERN = '(yotta|zetta|exa|peta|tera|giga|mega|kilo|y|z|e|p|t|g|m|k)\s*(bit|byte|b)?'; | |
public static $formatByteSize_Unit = 'mB'; | |
public static $formatByteSize_Format = '%0.2f %s'; |
View ConsoleParameters.php
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 | |
use ArrayAccess; | |
class ConsoleParameters implements ArrayAccess | |
{ | |
/** | |
* Prefix for flag names | |
* @var string | |
*/ |