Skip to content

Instantly share code, notes, and snippets.

View xiaods's full-sized avatar
🌏
Coding for Fun

Deshi Xiao xiaods

🌏
Coding for Fun
View GitHub Profile
@xiaods
xiaods / gist:952663
Created May 3, 2011 01:19 — forked from anonymous/gist:887026
reverse proxy for tumblr,reference
upstream tumblr {
server 72.32.231.8:80;
}
server {
listen 80;
server_name jyorr.com;
access_log /var/log/nginx/jyorr.access.log;
@xiaods
xiaods / tiny-rss-openshift-setup.md
Last active January 2, 2019 17:06
Google reader have gone, Setting Up Your Free Private Feed Reader.使用OpenShift的免费空间,配合Tiny-Tiny-Rss直接部署一个在线版的Rss Reader,经试用,支持中文挺好的。
  1. 下载tiny-tiny-rss source code
cd ~/src/git 
clone git://github.com/gothfox/Tiny-Tiny-RSS.git
  1. 创建openshift空间
def triangle(a, b, c)
if a == 0 || b == 0 || c == 0
raise TriangleError
end
if((a+b < c) || (a+c < b) || (b+c < a))
raise TriangleError
end
if a == b && b == c # && a == c
:equilateral
elsif a == b || b == c || c == a
def triangle(a, b, c)
raise TriangleError if [a,b,c].min <= 0
x, y, z = [a,b,c].sort
raise TriangleError if x + y <= z
[:equilateral,:isosceles,:scalene].fetch([a,b,c].uniq.size - 1)
end
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
// This will only work in environments that support ES6 Proxies.
// As of right now, that's pretty much only Firefox.
function Refrigerator(foods) {
this.foods = foods;
return new Proxy(this, {
get: function (receiver, name) {
if (name in receiver) {
mkdir panamax
cd panamax
curl -O http://download.panamax.io/installer/pmx-installer-latest.zip
unzip pmx-installer-latest.zip
sudo su
./coreos install --stable
@xiaods
xiaods / coreos-openstack
Last active November 22, 2015 05:00
setup coreos image on openstack step
# https://coreos.com/docs/running-coreos/platforms/openstack/
Step one:
```
$ wget http://alpha.release.core-os.net/amd64-usr/current/coreos_production_openstack_image.img.bz2
$ bunzip2 coreos_production_openstack_image.img.bz2
$ glance image-create --name CoreOS \
--container-format bare \
--disk-format qcow2 \
# /etc/security/limits.conf
* soft nofile 999999
* hard nofile 999999
root soft nofile 999999
root hard nofile 999999
===========================================================
# /etc/sysctl.conf
# sysctl for maximum tuning