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 SplDoublyLinkedListTest extends PHPUnit_Framework_TestCase | |
{ | |
public function testSplDoublyLinkedListPart1() | |
{ | |
$obj = new SplDoublyLinkedList(); | |
// Pushes value at the end of the doubly linked list. | |
$obj->push(0); | |
$obj->push(1); |
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 | |
ob_end_clean(); | |
if((int)ini_get('session.auto_start') > 0) | |
{ | |
ini_set('session.auto_start',0); | |
} | |
class MySqlSessionHandler implements SessionHandlerInterface | |
{ | |
private $_db; |
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
curl http://1111.ip138.com/ic.asp 2>/dev/null | grep '\[' | awk -F'[' '{print $2}' | awk -F']' '{print $1}' |
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 | |
$query = User::find() | |
->where(['id'=>[1,2,3,4]) | |
->select(['username']) | |
// get the AR raw sql in YII2 | |
$commandQuery = clone $query; | |
echo $commandQuery->createCommand()->getRawSql(); |
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
使用打包的 vagrant box 启动时报以下错误 | |
Configuring and enabling network interfaces... | |
The following SSH command responded with a non-zero exit status. | |
Vagrant assumes that this means the command failed! | |
/sbin/ifup eth1 2> /dev/null | |
解决办法 | |
vagrant ssh | |
rm -f /etc/udev/rules.d/70-persistent-net.rule |
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
package main | |
import ( | |
"fmt" | |
"strings" | |
) | |
type IPAddr [4]byte | |
// TODO: Add a "String() string" method to IPAddr. |
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
curl ip.cn |
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
$ docker images | |
FATA[0000] An error occurred trying to connect: Post https://192.168.199.243:2376/v1.18/containers/create: x509: certificate is valid for 127.0.0.1, 10.0.2.15, not 192.168.199.243 | |
# Answer https://github.com/docker/machine/issues/531 | |
$ docker --tlsverify=false images |
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
{"msg_item":[{"id":204993425,"type":9,"fakeid":"3076920206","nick_name":"敢玩","date_time":1427459682,"content":"","source":"mass","msg_status":2,"title":"敢玩初体验 | 告别不靠谱的副机长!普通人也能开飞机!","desc":"听到前两的德法坠机事件你对飞行产生恐惧?告别那些不靠谱的副机长吧,自己也可以亲身做一回副机长。看了视频你就","content_url":"http:\/\/mp.weixin.qq.com\/s?__biz=MzA3NjkyMDIwNg==&mid=204993424&idx=1&sn=3d49b4e5d8c688a1858c7fdb6bd65f88#rd","show_type":1,"file_id":204978640,"app_sub_type":3,"comment_url":"","has_reply":0,"refuse_reason":"","multi_item":[{"seq":0,"cover":"https:\/\/mmbiz.qlogo.cn\/mmbiz\/Nbw8zgku2MiaIF7hSpax7Vb75Ze2gZfJt2uDQ1v72Ds9RhlYT0hEE1L4YUJdA1zVwUqzBqI0ks8Dw0RIw8P53GA\/0","title":"敢玩初体验 | 告别不靠谱的副机长!普通人也能开飞机!","digest":"听到前两的德法坠机事件你对飞行产生恐惧?告别那些不靠谱的副机长吧,自己也可以亲身做一回副机长。看了视频你就","content_url":"http:\/\/mp.weixin.qq.com\/s?__biz=MzA3NjkyMDIwNg==&mid=204993424&idx=1&sn=3d49b4e5d8c688a1858c7fdb6bd65f88#rd","file_id":204978640,"content":"","source_url":"","author":"I Love","show_cover_pic":0,"del_flag":0,"vote_id":[],"copyright_status":100,"copyright_type |