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
DELETE FROM logs WHERE id IN (select id from (select id FROM log ORDER BY id DESC LIMIT 1000, 500) x) |
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 | |
/** | |
* Extension of base controller. | |
* Add additional controller functions and vars here. | |
*/ | |
namespace app\components; | |
use Yii; |
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 | |
# Extract JSON value | |
parse_json () { | |
echo $1 | \ | |
sed -e 's/[{}]/''/g' | \ | |
sed -e 's/", "/'\",\"'/g' | \ | |
sed -e 's/" ,"/'\",\"'/g' | \ | |
sed -e 's/" , "/'\",\"'/g' | \ | |
sed -e 's/","/'\"---SEPERATOR---\"'/g' | \ |
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 | |
/* | |
* Template Name: Szablon testowy | |
*/ | |
// taka prościzna do mierzenia czasu wykonania | |
function timeTook($start, $task = '') { | |
$execution_time = round( (microtime(true) - $start), 2); | |
return '<h4>Zadanie: <em>' . $task . '</em> zajęło: ' . $execution_time . ' sekund(y)</h4>'; | |
} |
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 | |
# Extract JSON value | |
parse_json () { | |
echo $1 | \ | |
sed -e 's/[{}]/''/g' | \ | |
sed -e 's/", "/'\",\"'/g' | \ | |
sed -e 's/" ,"/'\",\"'/g' | \ | |
sed -e 's/" , "/'\",\"'/g' | \ | |
sed -e 's/","/'\"---SEPERATOR---\"'/g' | \ |
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 | |
$showDate = "2019-07-16 20:00:00.0"; | |
$hideDate = "2019-07-22 20:00:00.0"; | |
$timezone = new DateTimeZone('Europe/Warsaw'); | |
$now = new DateTime(); | |
$now->setTimezone($timezone); | |
// If in timeframe | |
if( $now > new DateTime($showDate, $timezone) && $now < new DateTime($hideDate, $timezone) ) { | |
do_something(); |
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
/** | |
* Arduino USB HID Keyboard Demo | |
* Keys 1, 2, 3 and 4 on pins 4, 5, 6 and 7 | |
* | |
* @info check details on my website | |
* @link http://blog.realhe.ro | |
*/ | |
uint8_t buf[8] = { | |
0 }; /* Keyboard report buffer */ |
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
#Based on https://matomo.org/docs/log-analytics-tool-how-to/ | |
#------------------------------------------------------------------------ | |
# Config | |
#:: Python URL (must be 2.x) | |
$PY_BIN="C:\Program Files\Python\Python27\python.exe" | |
#:: Matomo import_logs executable | |
$IMPORT_LOGS="[path_to_piwik]\piwik\misc\log-analytics\import_logs.py" |
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
section: screens | |
Fabryka: | |
halfDuplexCapsLock = false | |
halfDuplexNumLock = false | |
halfDuplexScrollLock = false | |
xtestIsXineramaUnaware = false | |
switchCorners = none | |
switchCornerSize = 0 | |
Konrads-MacBook-Pro.local: | |
halfDuplexCapsLock = false |
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 | |
rm -rfv "$HOME/.vscode" | |
rm -rfv "$HOME/Library/Application Support/Code" | |
rm -rfv "$HOME/Library/Caches/com.microsoft.VSCode" | |
rm -rfv "$HOME/Library/Saved Application State/com.microsoft.VSCode.savedState" | |
# Thanks goes to offby1 from stackoverflow! |