This file contains hidden or 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 | |
apt-get install wget -y | |
wget 'https://coldcdn.com/api/cdn/f2cobx/terminal/v2.5.1/meson-linux-amd64.tar.gz' | |
tar -zxf meson-linux-amd64.tar.gz | |
cd ./meson-linux-amd64 | |
./meson service-install -token I0vOuOhJe1DBOn+/eC6Vog== -spacelimit 80 -port 19091 | |
./meson service-start | |
./meson service-status |
This file contains hidden or 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 | |
PROJECT=`php -r "echo dirname(dirname(dirname(realpath('$0'))));"` | |
STAGED_FILES_CMD=`git diff --cached --name-only --diff-filter=ACMR HEAD | grep \\\\.php` | |
# Determine if a file list is passed | |
if [ "$#" -eq 1 ] | |
then | |
oIFS=$IFS | |
IFS=' |
This file contains hidden or 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
slow_query_log = 1 | |
slow_query_log_file = /var/log/mysql/mysql-slow.log | |
long_query_time = 1 | |
log_queries_not_using_indexes | |
#then restart mysql server |
This file contains hidden or 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
#Stop and remove all Docker containers | |
docker stop $(docker ps -a -q) | |
docker rm $(docker ps -a -q) | |
#Remove all Docker images | |
docker rmi -f $(docker images -a) | |
#Remove unnecessary images before removing the image: | |
docker rmi $(docker images --filter "dangling=true" -q --no-trunc) |
This file contains hidden or 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
----- Esc ----- | |
Quick change directory: Esc + c | |
Quick change directory history: Esc + c and then Esc + h | |
Quick change directory previous entry: Esc + c and then Esc + p | |
Command line history: Esc + h | |
Command line previous command: Esc + p | |
View change: Esc + t (each time you do this shortcut a new directory view will appear) | |
Print current working directory in command line: Esc + a | |
Switch between background command line and MC: Ctrl + o | |
Search/Go to directory in active panel: Esc + s / Ctrl + s then start typing directory name |
This file contains hidden or 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 | |
/** | |
* Took the components necessary to render views from CController, adding it to a console command | |
*/ | |
class RenderReadyConsoleCommand extends CConsoleCommand | |
{ | |
protected $_widgetStack; | |
public function run($args) { } | |
public function renderPartial($view,$data=null,$return=true) | |
{ |
This file contains hidden or 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 | |
trait Singleton { | |
static private $instance = null; | |
private function __construct() { /* ... @return Singleton */ } // Protect from creation through new Singleton | |
private function __clone() { /* ... @return Singleton */ } // Protect from creation through clone | |
private function __wakeup() { /* ... @return Singleton */ } // Protect from creation through unserialize | |
static public function getInstance() { | |
return |
This file contains hidden or 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
Should also work for: | |
[v] any OpenSSH installation | |
Given, your key is in id_rsa | |
1 | |
Passphrase is needed? | |
Try some host which has your public key (id_rsa.pub) |
This file contains hidden or 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 | |
/** | |
* PHP-Shortcode is for creating bbcode like tags or what WordPress calls | |
* "shortcodes." The tag and attribute parsing or regular expression code is | |
* based on the Textpattern tag parser. | |
* | |
* A few examples are below: | |
* | |
* [shortcode /] | |
* [shortcode foo="bar" baz="bing" /] |
This file contains hidden or 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 | |
//The content which should be parsed | |
$content = '<p>Hello, my name is John an my age is [calc-age day="4" month="10" year="1991"].</p>'; | |
$content .= '<p>Hello, my name is Carol an my age is [calc-age day="26" month="11" year="1996"].</p>'; | |
//The array with all the shortcode handlers. This is just a regular associative array with anonymous functions as values. A very cool new feature in PHP, just like callbacks in JavaScript or delegates in C#. | |
$shortcodes = array( | |
"calc-age" => function($data){ | |
$content = ""; | |
//Calculate the age |
NewerOlder