for i in {1..100000}; do head -c 500 /dev/urandom > dummy$i; done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // https://play.golang.org/p/DnGeQsaGfi | |
| package main | |
| import ( | |
| "fmt" | |
| "reflect" | |
| ) | |
| type Ogp struct { | |
| Title string |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Nginx使用者請看這 | |
| 由於Let's Encrypt的安裝程式目前還沒有提供nginx模組(其實有在開發,只是還在測試階段),我們依舊可以透過安裝程式自動取得certification後,手動更新nginx的設定黨即可。 | |
| 首先,我們先取得免費的憑證: | |
| # 如果nginx正在執行中,請先把它關閉 | |
| $ sudo -s | |
| $ service nginx stop | |
| $ ./letsencrypt-auto certonly --email 你的email@你的email.net -d freessl.csie.io |
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.
elem.offsetLeft,elem.offsetTop,elem.offsetWidth,elem.offsetHeight,elem.offsetParent
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /usr/bin/env python3 | |
| import asyncio | |
| import contextlib | |
| async def ping(ip): | |
| p = await asyncio.create_subprocess_exec('ping', '-c', '4', ip, stdout=asyncio.subprocess.PIPE) | |
| async for line in p.stdout: | |
| print(line) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Bash script to install latest version of ffmpeg and its dependencies on Ubuntu 12.04 or 14.04 | |
| # Inspired from https://gist.github.com/faleev/3435377 | |
| # Remove any existing packages: | |
| sudo apt-get -y remove ffmpeg x264 libav-tools libvpx-dev libx264-dev | |
| # Get the dependencies (Ubuntu Server or headless users): | |
| sudo apt-get update |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 日本語用 | |
| $ sudo apt-get install libncursesw5-dev | |
| # ソースコード取得 | |
| $ git clone https://github.com/jonas/tig.git | |
| $ cd tig | |
| $ git checkout -b my-build-2.0.1 tig-2.0.1 | |
| # ビルド, インストール | |
| $ LDLIBS=-lncursesw CFLAGS=-I/usr/include/ncursesw make install prefix=$HOME/local |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import asyncio | |
| @asyncio.coroutine | |
| def waiting(r): | |
| print("hello from waiting -", r) | |
| yield from asyncio.sleep(2) | |
| print("bye from waiting -", r) | |
| return r |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta http-equiv="Content-Type" content="text/html; charset=utf8"> | |
| <title>Float Label Pattern</title> | |
| <link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css"> | |
| <style type="text/css" media="screen"> | |
| .row { | |
| /*position: relative;*/ | |
| padding-top: 24px; |
NewerOlder