Python 提供了两个基本的 socket 模块:
Socket
它提供了标准的BSD Socket API。SocketServer
它提供了服务器重心,可以简化网络服务器的开发。
下面讲解下 Socket模块功能。
// Handling Multiple Transitions | |
// http://stackoverflow.com/questions/5510568/multiple-properties-are-getting-treated-as-separate-arguments-in-mixins | |
.bitbr-transition(@value1,@value2:X,...) | |
{ | |
@value: ~`"@{arguments}".replace(/[\[\]]|\,\sX/g, '')`; | |
-webkit-transition: @value; | |
-moz-transition: @value; | |
-ms-transition: @value; | |
-o-transition: @value; |
#!/usr/bin/env python | |
# encoding: utf-8 | |
""" | |
eurl.py extracts all URLs (one per line) from the OPML file or URL. [I needed | |
this script produce a list of feed URLs so I could manually enter these RSS | |
feeds in the new Reeder 2 for iOS.] | |
Acknowledgement: Special thanks to Kurt McKee ( http://kurtmckee.org/ ) for the | |
script: http://stackoverflow.com/a/7782782 | |
""" |
import React from "react/addons"; | |
import m from "./m"; | |
// https://www.youtube.com/watch?v=GOiVYbWJDOA | |
export default class CyaSS extends React.Component { | |
constructor() { | |
super(); | |
this.state = { | |
hover: false, | |
active: false |
# Backup | |
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
# Restore | |
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |
""" | |
This module provides a decorator that can be added to any function to provide | |
debug output that shows the values of the arguments passed in as well as the | |
return value. If a Logger object is passed in to the decorator, all debug | |
output will go to that Logger object. Otherwise, the output will go to the | |
default Logger object. | |
Tip: If using the default Logger object, don't forget to set the logging level | |
to DEBUG if you want to see output on stdout. |
doctype html | |
<html !{helmet.htmlAttributes.toString()}> | |
head. | |
!{helmet.title.toString()} | |
!{helmet.meta.toString()} | |
!{helmet.link.toString()} | |
<body !{helmet.bodyAttributes.toString()}> | |
#root. | |
!{content} | |
script(src=assets['manifest.js']) |
'use strict'; | |
const Benchmark = require('benchmark'); | |
const benchmarks = require('beautify-benchmark'); | |
const suite = new Benchmark.Suite(); | |
const util = require('util'); | |
const assert = require('assert'); | |
class A { |
This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.
Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).