See how a minor change to your commit message style can make you a better programmer.
Format: <type>(<scope>): <subject>
<scope>
is optional
Become a Seeder: If you have a spare node (like a Raspberry PI with external HDD), you can setup a ZeroNet node here, which can automatically download and seen each new site published here.
Script to download new sites:
ZERO_DIR=~/ZeroNet-master
ZERO_HOST=127.0.0.1
Organization name: leexij@gmail.com | |
Serial Key: eNrzzU/OLi0odswsqslJTa3IzHJIz03MzNFLzs+tMTQyNrcwsTQyAIEa5xpDAIFxDy8k |
from restclient import GET, POST | |
import simplejson as json | |
import logging | |
import socket | |
logger = logging.getLogger('rs.utils.restclient') | |
class ConnectAPI(object): | |
''' | |
all the way of connection web and api server |
def _default_cls_attr(name, type_, cls_value): | |
# Proxy uses properties to forward the standard | |
# class attributes __module__, __name__ and __doc__ to the real | |
# object, but these needs to be a string when accessed from | |
# the Proxy class directly. This is a hack to make that work. | |
# -- See Issue #1087. | |
def __new__(cls, getter): | |
instance = type_.__new__(cls, cls_value) | |
instance.__getter = getter |
#!/usr/bin/env python | |
import redis | |
from ncelery import conf | |
class RedisClient(object): | |
""" | |
Singleton pattern | |
http://stackoverflow.com/questions/42558/python-and-the-singleton-pattern |
#!/usr/bin/env python | |
import redis | |
from ncelery import conf | |
class RedisClient(redis.StrictRedis): | |
""" | |
Singleton pattern | |
http://stackoverflow.com/questions/42558/python-and-the-singleton-pattern |
class RedisClient(redis.StrictRedis): | |
""" | |
Singleton pattern | |
http://stackoverflow.com/questions/42558/python-and-the-singleton-pattern | |
""" | |
_instance = {} | |
def __init__(self, server): |
#!/bin/bash | |
str="item1;item2;item3" | |
array=($(echo $str|tr ',' ' '|tr -s ' ')) #bash的方法 | |
echo ${array[1]} | |
#item2 | |
for s in ${arry[@]}; do echo "$s"; done | |
#item1 item2 item3 | |
#or use this method | |
OLD_IFS="$IFS" |
#! /bin/bash | |
# | |
# network Bring up/down networking | |
# | |
# chkconfig: 2345 10 90 | |
# description: Activates/Deactivates all network interfaces configured to \ | |
# start at boot time. | |
# | |
### BEGIN INIT INFO | |
# Provides: $network |