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
redis-cli KEYS "prefix:*" | xargs redis-cli DEL |
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
function str_putcsv($data) | |
{ | |
$fh = fopen('php://temp', 'rw'); | |
// write out the headers | |
fputcsv($fh, array_keys(current($data))); | |
// write out the data | |
foreach ( $data as $row ) { | |
fputcsv($fh, $row); |
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
gearman -n -w -f FUNCTION_NAME > /dev/null |
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
tmux attach || tmux new — делая так, вы сперва пытаетесь подключиться к уже существующему серверу tmux, если он существует; если такого ещё нет — создаёте новый. | |
Ctrl+b d — отключиться. | |
В одной сессии может быть сколько угодно окошек: | |
Ctrl+b c — создать окошко; | |
Ctrl+b 0...9 — перейти в такое-то окошко; | |
Ctrl+b p — перейти в предыдущее окошко; | |
Ctrl+b n — перейти в следующее окошко; | |
Ctrl+b l — перейти в предыдущее активное окошко (из которого вы переключились в текущее); |
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
(echo status ; sleep 0.1) | netcat 127.0.0.1 4730 |
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
sudo brew services start gearmand | |
sudo brew services start memcached |
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 | |
class InstagramController extends Controller | |
{ | |
public function actionRenderAjaxGrid() | |
{ | |
$data = []; // Array with your data | |
$this->render('_audience_exports', [ | |
'dataProvider' => new CArrayDataProvider($data) |
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
$this->widget('zii.widgets.CListView', array( | |
'dataProvider'=>$dataProvider, | |
'itemView'=>'_view', | |
'template'=>"{pager}<hr>\n{items}\n{pager}", | |
'pager' => array( | |
'firstPageLabel'=>'<', | |
'prevPageLabel'=>'<', | |
'nextPageLabel'=>'>', | |
'lastPageLabel'=>'>>', | |
'maxButtonCount'=>'10', |
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
// MongoDB drop index | |
db.users.dropIndex("cid_1"); | |
// MongoDB create index | |
db.users.createIndex({"name" : 1}, {"unique" : true}) | |
// MongoDB update upsert | |
db.people.update( | |
{ name: "Andy" }, | |
{ |
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
<div class="photos-line"> | |
<div class="photo"> | |
<img src="https://scontent.cdninstagram.com/t51.2885-15/s640x640/e35/22860491_293564051135946_1431999210961502208_n.jpg"> | |
</div> | |
<div class="photo"> | |
<img src="https://scontent.cdninstagram.com/t51.2885-15/s640x640/e35/23347493_138848026766173_4147715403113562112_n.jpg"> | |
</div> | |
<div class="photo"> | |
<img src="https://scontent.cdninstagram.com/t51.2885-15/e35/p320x320/23498171_1512204415482005_7319427710441226240_n.jpg"> | |
</div> |
NewerOlder