Skip to content

Instantly share code, notes, and snippets.

View liruqi's full-sized avatar

Ruqi liruqi

View GitHub Profile
@liruqi
liruqi / config
Created March 25, 2015 03:53
My software config
Terminal:
Menlo Regular 13 pt.
@liruqi
liruqi / yii2-droplist
Last active August 29, 2015 14:17
Yii2 Drop list down value mapping
<?php
# Drop down list value mapping
# File models/Report.php
public function areaTypeMapping() {
return ['公共区域', '办公区域'];
}
# views/report/_form.php
@liruqi
liruqi / iptables.conf
Last active June 25, 2017 15:12
iptables conf for 80 port HTTP proxy
#Drop ad click
IPSET=`which ipset`
match_set=""
if [ -x "$IPSET" ]; then
if $IPSET --version; then
if [ ! -f CHINA ]; then
wget "https://raw.github.com/liruqi/west-chamber-season-3/master/CHINA"
fi
正标题:SPECTACULAR FUTURE
副标题:ECO-CITY WITH PASSIVE HOUSE
作者简介:(配我的照片)
Qian Zhang, 20, Beijing
Qian is currently pursuing a bachelor’s degree in HAVC (Heating, Ventilating and Air Conditioning) at Beijing University of Civil Engineering and Architecture.
She had named “Beijing outstanding student cadre”.
Her studies focus on energy saving building.
Research Interests: Energy Saving Building, Room Environment, Interior Ventilation.

平台:DigitalOcean VPS ubuntu14.04 x64, strongswan5.2.2 运行以下命令请使用root权限

一:安装strongswan

由于ubuntu软件仓库中strongswan版本较低,因此从官网源码编译安装

apt-get install build-essential     #编译环境
aptitude install libgmp10 libgmp3-dev libssl-dev pkg-config libpcsclite-dev libpam0g-dev     #编译所需要的软件
@liruqi
liruqi / facebook_email.js
Last active December 26, 2019 10:04
Get facebook fans email
var run = 0;
var mails = {}
total = 3000; //滚动次数,可以自己根据情况定义
function getEmails (cont) {
var friendbutton=cont.getElementsByClassName("_ohe");
for(var i=0; i<friendbutton.length; i++) {
var link = friendbutton[i].getAttribute("href");
if(link && link.substr(0,25)=="https://www.facebook.com/") {
@liruqi
liruqi / center2views.m
Created January 20, 2016 07:24
Put to adjacent view in the horizontal middle of screen
// No working anyway
CGSize screenSz = [UIScreen mainScreen].bounds.size;
CGSize leftSz = [self.haveAccountLabel intrinsicContentSize];
CGSize rightSz = [self.signInButton intrinsicContentSize];
CGFloat contentWidth = leftSz.width + rightSz.width + 8;
CGFloat x = (screenSz.width - contentWidth) / 2;
if (x < 0) {
NSLog(@"Text overflow %lf > %lf", contentWidth, screenSz.width);
@liruqi
liruqi / NSPZeroMarginCell.m
Last active February 23, 2016 21:55
Zero content margin UITableViewCell
// Hide separator for specific cell is extremely hard in iOS 9.
// None of these worked or good enough for me:
// http://stackoverflow.com/questions/8561774/hide-separator-line-on-one-uitableviewcell
@interface NSPZeroMarginCell : UITableViewCell
@property (nonatomic, assign) BOOL separatorHidden;
@end
== iOS ==
===Build guide===
* https://github.com/actorapp/actor-bootstrap/tree/master/docs/server
== Configuration ==
===File Storage===
AWS S3 or file system on actor server
* AWS S3: https://github.com/actorapp/actor-bootstrap/blob/master/docs/server/configure-s3.md
* Steps: [http://roomchat-cn.azurewebsites.net/oss/actor/aws-s3-cors1.jpg],[http://roomchat-cn.azurewebsites.net/oss/actor/aws-s3-cors2.jpg]
ALTER TABLE beijing_house add column `usage` varchar(16) default NULL;
ALTER TABLE `beijing_house` add column `createtime` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP;