Skip to content

Instantly share code, notes, and snippets.

View jebai0521's full-sized avatar
🎯
Focusing

Chen Ming jebai0521

🎯
Focusing
View GitHub Profile
@jebai0521
jebai0521 / gist:b8cce06abac69de6611f
Created February 1, 2015 05:57
后台起mongod
# 方法1:(推荐)
# --fork 选项将会通知 mongod 在后台运行
/path/to/MongoDB_Dir/bin/mongod --logpath /path/to/file.log --logappend --fork
# 方法2:
# 将输出重定向到 file.log 文件
# & 将该进程置于后台运行
/path/to/MongoDB_Dir/bin/mongod >> /path/to/file.log &
@jebai0521
jebai0521 / gist:ff61f9840afe9ff348d9
Created April 9, 2015 03:03
print full content of object in nodejs
console.log(util.inspect(mergeData, false, null));
@jebai0521
jebai0521 / gist:6c40cb84133291934019
Last active August 29, 2015 14:18
html 图片居中
align="center"使用方法:
<div align="center"></div>
<!DOCTYPE >
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="viewport" content="width=device-width"/>
<meta charset="utf-8" />
<style type="text/css">
@jebai0521
jebai0521 / geo.md
Last active August 29, 2015 14:20 — forked from benbahrenburg/geo.md

Fixing Geo Location Permissions in iOS8

In iOS8, Apple has changed how geo location permissions work. This gist outlines an approach to fix this so Geo will continue to work in iOS8.

Before getting started with the code change, we need to update the tiapp.xml with a few keys.

If you wish to have Geo always run, you need to add the below key. The key NSLocationAlwaysUsageDescription is used when requesting permission to use location services whenever the app is running. To enable this, add the below to the tiapp.xml:

NSLocationAlwaysUsageDescription Reason that appears in the authorization prompt

# LOGGING = {
# 'version': 1,
# 'disable_existing_loggers': True,
# 'formatters': {
# 'standard': {
# 'format': '%(asctime)s [%(threadName)s:%(thread)d] [%(name)s:%(lineno)d] [%(levelname)s]- %(message)s'
# },
# },
# 'filters': {
# },
# SQLite3
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}
# MySQL
DATABASES = {
ubuntu查看占用某端口的程序
sof -i:8888
重启mac声卡
sudo kextunload /System/Library/Extensions/AppleHDA.kext
sudo kextload /System/Library/Extensions/AppleHDA.kext
>>> print "\u624b\u673a\u7c7b\u578b".decode('unicode_escape')
手机类型
>>> print "\U65b9\U6cd5method\U4e0d\U5b58\U5728".decode('unicode_escape’)
>>> print "\u65b9\U6cd5method\U4e0d\U5b58\U5728".decode('unicode_escape')