Skip to content

Instantly share code, notes, and snippets.


liuyanghejerry liuyanghejerry

View GitHub Profile
liuyanghejerry / index.html
Last active May 27, 2019
Modern index file in 2017
View index.html
<!DOCTYPE html>
<html prefix="og:">
<!-- content-type, which overrides http equivalent header. Because of charset, this meta should be set at first. -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<!-- Overrides http equivalent header. This tells IE to use the most updated engine. -->
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<!-- Tells crawlers how to crawl this page, and the role of this page. -->
<meta name="robots" content="index, follow">
liuyanghejerry / gist:a309ef54580004879b40
Created May 7, 2014
View gist:a309ef54580004879b40






liuyanghejerry / index.html
Last active Jan 21, 2016 — forked from anonymous/index.html
Short sample to illustrate :lang() // source
View index.html
<!DOCTYPE html>
<html lang="zh">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style id="jsbin-css">
.target:lang(zh) {
color: green;
liuyanghejerry / 0_reuse_code.js
Created Dec 28, 2013
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
liuyanghejerry / is_in_dict.cpp
Last active Dec 25, 2015
给定字符串,以及一个字典,判断字符串是否能够拆分为字段中的单词。例如,字段为{hello,world},字符串为hellohelloworld,则可以拆分为hello,hello,world,都是字典中的单词。 题目来源: 原题解是动态规划,本代码是备忘录式的递归法。
View is_in_dict.cpp
#include <iostream>
#include <string>
#include <unordered_map> // need c++11 or c++0x
using namespace std;
unordered_map<string, bool> dict;
unordered_map<string, bool> memo;
inline bool is_in_dict_pri(const string& word)
liuyanghejerry / main.cpp
Created Oct 12, 2013
Calculate how many different IP in painttyServer's log.
View main.cpp
#include <QCoreApplication>
#include <QFile>
#include <QFileInfo>
#include <QTextStream>
#include <QStringList>
#include <QDebug>
int main(int argc, char *argv[])
QCoreApplication a(argc, argv);
liuyanghejerry /
Created Aug 11, 2013
This is a test case of tablet support for Qt 5.
QT += core gui concurrent
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = PainterTest
CONFIG += c++11
SOURCES += main.cpp\
liuyanghejerry /
Last active Dec 16, 2015
Redis-server management script for CentOS 6.3.
# chkconfig: - 80 12
# description: Controller for redis-server
# processname: redis
# useage: redis {start|stop|restart}
# notice, you need to edit these 4 variables bellow to suit your condition
View index.html
<!DOCTYPE html>
<script src=""></script>
<script src=""></script>
<meta charset="utf-8">
<title>JS Bin</title>
<style id="jsbin-css">
.rating-table {
border: 0;
liuyanghejerry /
Created Dec 4, 2015
Safely install Python 2.7 on CentOS 6.5+
yum install centos-release-SCL
yum install python27 python27-scldevel
# then add those line to your .bash_rc or .bash_profile
# note that space between dot and slash
# . /opt/rh/python27/enable
# Or if you want a better solution:
You can’t perform that action at this time.