Skip to content

Instantly share code, notes, and snippets.

Avatar

wwj718

View GitHub Profile
View test
{
// 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 Sep 19, 2018
一些CDN公共库,常用的js,css公共库
View 一些CDN公共库.md

#说明:

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

##百度公共库

  • [地址](http://developer.baidu.com/wiki/index.php?title=docs/cplat/libs)
  • 百度公共CDN为您的应用程序提供稳定、可靠、高速的服务,包含全球所有最流行的开源JavaScript库
  • 如果对版本要求不严,百度的公共库的确提供了一个很好的解决方案,不管从速度和稳定性方面都不错
  • 百度CDN最明显的优势就是速度快
View bootstrap-start.html
<!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
简单清晰的Django
View easy_django.py
#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(
View bootstrap2-begin.html
<!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 Sep 15, 2014
代码版本更新提示
View 提示用户更.py
UpdateTime = urllib2.urlopen(u"http://zhihuhelpbyyzy-zhihu.stor.sinaapp.com/ZhihuHelpUpdateTime.txt",timeout=10) #线上总部
import webbrowser
webbrowser.open_new_tab(url) #调用浏览器
View gist:3e74da1abf5439ff189c
#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()
View gist:a0f25814b24e6c2d5c3b
# 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
View _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
You can’t perform that action at this time.