看来 jQuery 你已经用得很爽了,想学习如何自己编写插件。非常好,这篇文档正适合你。用插件和方法来扩展 jQuery 非常强大,把最聪明的功能封装到插件中可以为你及团队节省大量开发时间。
#! /usr/bin/python | |
""" | |
This simple script makes it easy to create server certificates | |
that are signed by your own Certificate Authority. | |
Mostly, this script just automates the workflow explained | |
in http://www.tc.umn.edu/~brams006/selfsign.html. | |
Before using this script, you'll need to create a private |
I use tmux splits (panes). Inside one of these panes there's a Vim process, and it has its own splits (windows).
In Vim I have key bindings C-h/j/k/l
set to switch windows in the given direction. (Vim default mappings for windows switching are the same, but prefixed with C-W
.) I'd like to use the same keystrokes for switching tmux panes.
An extra goal that I've solved with a dirty hack is to toggle between last active panes with C-\
.
Here's how it should work:
//http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript | |
Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15); |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>circle progressbar</title> | |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> | |
<script type="text/javascript"> | |
$(document).ready(function(){ | |
var range = $('#range'); | |
var bg = $('#counter'); | |
var ctx = bg[0].getContext('2d'); |
# http://stackoverflow.com/questions/20211990/sending-data-curl-json-in-python | |
import requests #pip install requests | |
import simplejson as json #pip install simplejson | |
url = "http://<ip-address>:3030" | |
widget = "welcome" | |
data = { "auth_token": "YOUR_AUTH_TOKEN", "text": "Python Greetings!!" } | |
fullUrl = "%s/widgets/%s" % (url, widget) |
from celery import Celery | |
from celery.signals import after_task_publish,task_success,task_prerun,task_postrun | |
# first argument, current module | |
app = Celery('tasks') | |
app.config_from_object('celeryconfig') | |
# To instantiate celery and import this module | |
# do: celery -A task worker --loglevel=info | |
# after, once celery is running, instantiate a python console: |
#!/usr/bin/env python | |
import socket | |
import binascii | |
import threading | |
import time | |
import json | |
reconnect_flag = 0 |
After watching Bryan Cantrill's presentation on [Running Aground: Debugging Docker in Production][aground] I got all excited (and strangely nostalgic) about the possibility of core-dumping server-side Python apps whenever they go awry. This would theoretically allow me to fully inspect the state of the program at the point it exploded, rather than relying solely on the information of a stack trace.