Skip to content

Instantly share code, notes, and snippets.

View wwj718's full-sized avatar

wwj718

View GitHub Profile
import os
@wwj718
wwj718 / test
Created September 25, 2013 14:09
hello
{
// Your GitHub API token
// see: https://github.com/condemil/Gist#generating-access-token
"token": "b325b9d4af450496dfd6fbf338fe7a8bf5201da3",
// Show GitHub organizations
// Example: "company1", "company2"
"include_orgs": [],
// Show GitHub users
@wwj718
wwj718 / 一些CDN公共库.md
Last active September 19, 2018 03:22
一些CDN公共库,常用的js,css公共库

#说明:

  • google的公共库国内访问不稳定
  • 与将JS库存放在服务器单机上相比,CDN公共库更加稳定、高速。

##百度公共库

  • [地址](http://developer.baidu.com/wiki/index.php?title=docs/cplat/libs)
  • 百度公共CDN为您的应用程序提供稳定、可靠、高速的服务,包含全球所有最流行的开源JavaScript库
  • 如果对版本要求不严,百度的公共库的确提供了一个很好的解决方案,不管从速度和稳定性方面都不错
  • 百度CDN最明显的优势就是速度快
@wwj718
wwj718 / bootstrap-start.html
Last active December 28, 2015 06:58
bootstrap-start
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" >
<link href="http://libs.baidu.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet">
<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
<script src="http://libs.baidu.com/bootstrap/3.0.3/js/bootstrap.min.js"></script>
</head>
@wwj718
wwj718 / easy_django.py
Created May 8, 2014 02:28
简单清晰的Django
#coding=utf-8
import sys
from django.conf import settings
from django.conf.urls import patterns
from django.http import HttpResponse
from django.core.management import execute_from_command_line
settings.configure(
@wwj718
wwj718 / bootstrap2-begin.html
Created May 31, 2014 11:57
bootstrap2-begin
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" >
<link href="http://libs.baidu.com/bootstrap/2.3.2/css/bootstrap.min.css" rel="stylesheet">
<link href="http://cdn.bootcss.com/bootstrap/2.3.2/css/bootstrap-responsive.min.css" rel="stylesheet">
<script src="http://libs.baidu.com/jquery/1.8.2/jquery.min.js"></script>
<script src="http://libs.baidu.com/bootstrap/2.3.2/js/bootstrap.min.js"></script>
</head>
@wwj718
wwj718 / 提示用户更.py
Created September 15, 2014 05:45
代码版本更新提示
UpdateTime = urllib2.urlopen(u"http://zhihuhelpbyyzy-zhihu.stor.sinaapp.com/ZhihuHelpUpdateTime.txt",timeout=10) #线上总部
import webbrowser
webbrowser.open_new_tab(url) #调用浏览器
#coding:utf-8
#django test 中模拟登录的request
from django.contrib.sessions.middleware import SessionMiddleware
from django.test.client import RequestFactory
def add_session_to_request(request):
"""Annotate a request object with a session"""
middleware = SessionMiddleware()
# Settings that can be used when running inside of a docker container
[hive]
release = apache
database = default
warehouse_path = hdfs://hadoop:9000/edx-analytics-pipeline/warehouse/
[database-export]
database = analytics
#credentials = hdfs://hadoop:9000/edx-analytics-pipeline/output/local.json
@wwj718
wwj718 / _update_with_kwargs.py
Created July 7, 2015 03:24
update_with_kwargs.py
def _update_with_kwargs(data_dict, **kwargs):
"""Updates a dict from kwargs only if it modifies a top-level value."""
for key, value in kwargs.iteritems():
if key in data_dict:
data_dict[key] = value