Skip to content

Instantly share code, notes, and snippets.

@period331
period331 / test.py
Created Jul 17, 2020
命令行布局管理器 Python命令行下多行刷新
View test.py
# -*- coding:utf8 -*-
import time,sys
def progressbar():
print 'Loading...'
print "[+] start to build...."
height = 4
for i in range(0, 100):
if i > 0:
sys.stdout.write(u'\u001b[1A')
time.sleep(0.1)
View daemon_example.py
""" An example of a Linux daemon written in Python.
Based on http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/
The changes are:
1 - Uses file open context managers instead of calls to file().
2 - Forces stdin to /dev/null. stdout and stderr go to log files.
3 - Uses print instead of sys.stdout.write prior to pointing stdout to the log file.
4 - Omits try/excepts if they only wrap one error message w/ another.
@period331
period331 / fpm.d目录下的www.conf
Last active Apr 25, 2016
nginx-php开发环境配置
View fpm.d目录下的www.conf
;;;;;;;;;;;;;;;;;;;;;;;
; Pool Definitions ;
; 只关注需要修改的配置;
;;;;;;;;;;;;;;;;;;;;;;;
; 以登陆用户的用户名和分组,避免权限问题
user = baocaixiong
group = staff
; The address on which to accept FastCGI requests.
View Nginx-Config-Pitfalls.md

原文

警告:请务必读完本文!全篇读完!

无论新老用户,都有可能掉进陷阱。 下面我们列出了常见的问题,并解释如何解决他们。 在 Freenode IRC 的 #nginx 频道,我们经常看到这些问题。

[TOC]

@period331
period331 / EqualTest.m
Created Dec 9, 2014
== and isEqual Objective-C
View EqualTest.m
#import <Foundation/Foundation.h>
int main(int argc, char * argv[])
{
@autoreleasepool {
NSString * str1 = @"hello";
NSString * str2 = [NSString stringWithFormat:@"hello"];
NSLog(@"str1 == str2 ??; %d", (str1 == str2)); // 输出 0
View gist:cd268e049616a762dfc5
#import <Foundation/Foundation.h>
@interface FKFruit : NSObject
@property(nonatomic, assign) double weight;
@property(nonatomic, assign) int a;
-(void) info;
@end
View gist:650cca19ea383c8c614a
#import <Foundation/Foundation.h>
@interface FKItem : NSObject
@property(nonatomic) NSString * name;
@property(nonatomic) int price;
@end
@implementation FKItem
View meta_class.py
# coding: utf-8
_STANDARDS = '__standards__'
class _StdData(type):
def __new__(mcs, name, bases, attrs):
super_new = super(_StdData, mcs).__new__
parents = [b for b in bases if isinstance(b, _StdData)]
View google global cache
IP Addresses of Google Global Cache
www.kookle.co.nr
Bulgaria 93.123.23.1 93.123.23.2 93.123.23.3 93.123.23.4 93.123.23.5 93.123.23.6 93.123.23.7 93.123.23.8 93.123.23.9
93.123.23.10 93.123.23.11 93.123.23.12 93.123.23.13 93.123.23.14 93.123.23.15 93.123.23.16 93.123.23.17 93.123.23.18 93.123.23.19
93.123.23.20 93.123.23.21 93.123.23.22 93.123.23.23 93.123.23.24 93.123.23.25 93.123.23.26 93.123.23.27 93.123.23.28 93.123.23.29
93.123.23.30 93.123.23.31 93.123.23.32 93.123.23.33 93.123.23.34 93.123.23.35 93.123.23.36 93.123.23.37 93.123.23.38 93.123.23.39
93.123.23.40 93.123.23.41 93.123.23.42 93.123.23.43 93.123.23.44 93.123.23.45 93.123.23.46 93.123.23.47 93.123.23.48 93.123.23.49
93.123.23.50 93.123.23.51 93.123.23.52 93.123.23.53 93.123.23.54 93.123.23.55 93.123.23.56 93.123.23.57 93.123.23.58 93.123.23.59
Egypt 197.199.253.1 197.199.253.2 197.199.253.3 197.199.253.4 197.199.253.5 197.199.253.6 197.199.253.7 197.199.253.8 197.199.253.9