start new:
tmux
start new with session name:
tmux new -s myname
# -*- coding: UTF-8 -*- | |
from flaskext.wtf import Form, TextField, PasswordField, RecaptchaField, \ | |
AnyOf, NoneOf, Regexp, Email, Required, EqualTo, Recaptcha | |
from wtforms.validators import StopValidation | |
from flask import request, session | |
import model | |
# 身份證字號格式驗證 | |
def check_ID(form, field): | |
locations = dict(zip([c for c in 'ABCDEFGHJKLMNPQRSTUVXYWZIO'], range(10,36))) |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Title</title> | |
</head> | |
<body> | |
<form method="post"> | |
{{ form.hidden_tag() }} | |
{{ form.example }} |
This procedure is tested on Mac OS X 10.8 with Developpers tools installed (xCode).
PHP 5.4 installed with Homebrew.
Update: I wrote a blog post about this.
Download the following files from Oracle website (yes, you need to create an account and accept terms):
/** | |
* - chrome为了安全考虑,设计的不支持js操作加入收藏夹, | |
* - 火狐23之后开始废止window.sidebar因为不是w3c标注 https://bugzilla.mozilla.org/show_bug.cgi?id=691647 | |
* - document.all 判断IE不够靠谱,因为现在许多浏览器也实现了document.all吗,并且IE11以后(document.all)为falsy | |
* - 参考 http://stackoverflow.com/questions/10033215/add-to-favorites-button | |
* - IE 中typeof window.external.addFavorite 为'unknown' [http://www.xdarui.com/archives/203.html]; | |
*/ | |
var url = 'https://gist.github.com/', | |
title = 'gist代码片段'; |
#! /bin/bash | |
# | |
# Diffusion youtube avec ffmpeg | |
# Configurer youtube avec une résolution 720p. La vidéo n'est pas scalée. | |
VBR="2500k" # Bitrate de la vidéo en sortie | |
FPS="30" # FPS de la vidéo en sortie | |
QUAL="medium" # Preset de qualité FFMPEG | |
YOUTUBE_URL="rtmp://a.rtmp.youtube.com/live2" # URL de base RTMP youtube |
# -*- coding: utf-8 -*- | |
import socket | |
import os | |
print("Connecting...") | |
if os.path.exists("/tmp/python_unix_sockets_example"): | |
client = socket.socket(socket.AF_UNIX, socket.SOCK_DGRAM) | |
client.connect("/tmp/python_unix_sockets_example") | |
print("Ready.") | |
print("Ctrl-C to quit.") |
package com.company.project.controllers; | |
import com.company.project.model.api.ErrorJson; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.beans.factory.annotation.Value; | |
import org.springframework.boot.autoconfigure.web.ErrorAttributes; | |
import org.springframework.boot.autoconfigure.web.ErrorController; | |
import org.springframework.web.bind.annotation.RequestMapping; | |
import org.springframework.web.bind.annotation.RestController; | |
import org.springframework.web.context.request.RequestAttributes; |
#!/bin/bash | |
# see http://oracle-base.com/articles/linux/linux-firewall.php | |
# Set the default policies to allow everything while we set up new rules | |
# Prevents cutting yourself off when running from remote SSH | |
iptables -P INPUT ACCEPT | |
iptables -P FORWARD ACCEPT | |
iptables -P OUTPUT ACCEPT |