This file contains 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
func getGoRoutineId() uint64 { | |
b := make([]byte, 32) | |
b = b[:runtime.Stack(b, false)] | |
b = bytes.TrimPrefix(b, []byte("goroutine ")) | |
b = b[:bytes.IndexByte(b, ' ')] | |
id, err := strconv.ParseUint(string(b), 10, 64) | |
if err != nil { | |
log.Panicf("Cannot parse goroutine id from %v: %v", b, err) | |
} |
This file contains 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><title>嵌入SVG图片的N种方式</title></head> | |
<body> | |
<h3>0. 使用`svg`标签</h3> | |
<svg version="1.1" | |
preserveAspectRatio="xMinYMin meet" | |
viewBox="0 0 660 342" | |
width="660" height="342" | |
xmlns="http://www.w3.org/2000/svg" |
This file contains 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
.AppHeader-inner, | |
.Footer, | |
.Card.AppBanner, | |
.Card[data-za-module=RelatedLives]{ | |
display: none !important; | |
} | |
.Card{ | |
position: relative; | |
z-index: 1; | |
} |
This file contains 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
#include "windows.h" | |
#include <tchar.h> | |
#include <stdio.h> | |
#define BUFSIZE 4096 | |
void _tmain(int argc, TCHAR *argv[]) | |
{ | |
DWORD retval=0; | |
BOOL success; |
This file contains 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
<?php | |
function html_entity_encode_unicode($str) { | |
$str = mb_convert_encoding($str , 'UTF-32', 'UTF-8'); | |
$t = unpack("N*", $str); | |
$t = array_map(function($n) { | |
return $n < 128 ? chr($n) : "&#$n;"; | |
}, $t); |
This file contains 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> | |
<title>Product Discount On Top Left Corner</title> | |
<style> | |
.product{ | |
border: 1px solid black; | |
width: 400px; | |
height: 300px; | |
position: relative; |
This file contains 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
<?php | |
return [ | |
/* | |
|-------------------------------------------------------------------------- | |
| Validation Language Lines | |
|-------------------------------------------------------------------------- | |
| | |
| The following language lines contain the default error messages used by |
This file contains 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
<?php | |
$testRounds = 100; | |
$testTimes = 1000000; | |
$times = []; | |
$data = 'abcdefgh'; | |
for ($i = 0; $i < $testRounds; $i++){ | |
$begin = microtime(true); |
This file contains 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
<?xml version="1.0"?> | |
<?mso-application progid="Excel.Sheet"?> | |
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" | |
xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"> | |
<Worksheet ss:Name="tt"> | |
<Table> | |
<Row> | |
<Cell><Data ss:Type="String">Hello</Data></Cell> | |
</Row> | |
<Row> |
This file contains 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
<?php | |
echo sprintf("%10s %10s\n", 'cost', 'time'); | |
for ($cost = 8; $cost < 20; $cost++) { | |
$begin = microtime(true); | |
password_hash('test1234', PASSWORD_BCRYPT, ['cost' => $cost]); | |
$delta = microtime(true) - $begin; |