Skip to content

Instantly share code, notes, and snippets.

View ego008's full-sized avatar
🏠
Working from home

Ybb ego008

🏠
Working from home
View GitHub Profile
<!-- 把下面内容放在,文章底部 -->
<div class="c"></div>
<div id="bdshare" class="bdshare_t bds_tools get-codes-bdshare">
<span class="bds_more">分享到:</span>
<a class="bds_qzone"></a>
<a class="bds_tsina"></a>
<a class="bds_tqq"></a>
<a class="bds_renren"></a>
<a class="bds_t163"></a>
<?php
define('SAESPOT_VER', '1.02');
$IS_SAE = isset($_SERVER['HTTP_APPNAME']);
if ($IS_SAE){
//数据库主机名或IP 主
$servername_m = SAE_MYSQL_HOST_M;
//数据库主机名或IP 从
$servername_s = SAE_MYSQL_HOST_S;
//数据库用户名
INSERT INTO yunbbs_settings VALUES('site_des', '');
INSERT INTO yunbbs_settings VALUES('spam_words', '');
INSERT INTO yunbbs_settings VALUES('qq_scope', 'get_user_info');
INSERT INTO yunbbs_settings VALUES('qq_appid', '');
INSERT INTO yunbbs_settings VALUES('qq_appkey', '');
ALTER TABLE `yunbbs_articles` ADD `favorites` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0' AFTER `closecomment` ;
ALTER TABLE `yunbbs_articles` ADD `visible` TINYINT( 1 ) NOT NULL DEFAULT '1' AFTER `favorites` ;
ALTER TABLE `yunbbs_categories` ADD `about` TEXT NOT NULL DEFAULT '' AFTER `articles` ;
@ego008
ego008 / gist:4529226
Created January 14, 2013 10:45
youBBS 1.03 to 1.04 sql
INSERT INTO yunbbs_settings VALUES('wb_key', '');
INSERT INTO yunbbs_settings VALUES('wb_secret', '');
CREATE TABLE yunbbs_weibo (
id mediumint(8) unsigned NOT NULL auto_increment,
uid mediumint(8) unsigned NOT NULL default '0',
name varchar(20) NOT NULL default '',
openid char(12) NOT NULL,
PRIMARY KEY (id),
KEY uid (uid),
# -*- coding: utf-8 -*-
"""
Example of how to use Poster.encode on AppEngine.
http://atlee.ca/software/poster/
The only variation needed versus the example from Poster is that
GAE's UrlFetch cannot use the generator returned by multipart_encode()
for payload, so simply create a payload string first.
"""
@ego008
ego008 / gist:8401680
Created January 13, 2014 14:53
SAE mysql 事务示例
$sql_a = '...';
$sql_b = '...';
$mysql->runSql("BEGIN");
$res_a = $mysql->runSql($sql_a);
$res_b = $mysql->runSql($sql_b);
if ($res_a && $res_b) {
$mysql->runSql("COMMIT");
rewrite ^/n-([0-9]+)(-([0-9]*))?$ /nodepage.php?cid=$1&page=$3 last;
rewrite ^/t-([0-9]+)(-([0-9]*))?$ /topicpage.php?tid=$1&page=$3 last;
rewrite ^/page/([0-9]+)$ /indexpage.php?page=$1 last;
rewrite ^/notifications$ /notifications.php last;
rewrite ^/favorites$ /favorites.php last;
rewrite ^/qqlogin$ /qqlogin.php last;
rewrite ^/qqcallback$ /qqcallback.php last;
rewrite ^/qqsetname$ /qqsetname.php last;
rewrite ^/wblogin$ /wblogin.php last;
rewrite ^/wbcallback$ /wbcallback.php last;
# coding: utf-8
#
# Copyright (c) Alexandr Emelin. BSD license.
# All rights reserved.
#
"""
class GithubAuthHandler(BaseHandler, auth.GithubMixin):
x_site_token = 'application'
# coding: utf-8
#
# Copyright (c) Alexandr Emelin. BSD license.
# All rights reserved.
#
"""
class GithubAuthHandler(BaseHandler, auth.GithubMixin):
x_site_token = 'application'
@ego008
ego008 / supervisord.sh
Created November 1, 2015 02:55 — forked from danmackinlay/supervisord.sh
an init.d script for supervisord
#! /bin/sh
### BEGIN INIT INFO
# Provides: supervisord
# Required-Start: $remote_fs
# Required-Stop: $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Example initscript
# Description: This file should be used to construct scripts to be
# placed in /etc/init.d.