- Use the present tense ("Add feature" not "Added feature")
- Use the imperative mood ("Move cursor to..." not "Moves cursor to...")
- Limit the first line to 72 characters or less
- Reference issues and pull requests liberally after the first line
- When only changing documentation, include
[ci skip]
in the commit title - Consider starting the commit message with an applicable emoji
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
package main | |
import ( | |
"cloud.google.com/go/storage" | |
"context" | |
"log" | |
) | |
const ( | |
projectID = "your-project-id" // FILL IN WITH YOURS |
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
#!/bin/bash | |
# | |
# 1. create a EC2 instance with public IP | |
# 2. create a A RR in route53 pointing your.domain.com to the public IP | |
# 3. make sure HTTP/HTTPS ports(80 443) are public to all in security group of this EC2 instance | |
# 4. make sure docker daemon is running in this EC2 instance | |
# 5. run this script ! | |
# 6. keys/cert will be generated under /root/letsencrypt/etc/live/ | |
mkdir -p /root/letsencrypt/log /root/letsencrypt/lib /root/letsencrypt/etc |
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
package math | |
type A struct { | |
FieldA1 int32 | |
FieldA2 int32 | |
} | |
func (this A) MarshalJSON() ([]byte, error) { | |
m := make(map[string]interface{}, 3) | |
m["FieldA1"] = this.FieldA1 |
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
FROM debian:stretch | |
ENV LC_ALL en_US.UTF-8 | |
ENV LANG en_US.UTF-8 | |
RUN apt-get update && apt-get install -y \ | |
apt-transport-https \ | |
ca-certificates \ | |
curl \ | |
gconf2 \ |
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
$ VBoxManage list usbhost | |
Host USB Devices: | |
... | |
UUID: 248ee848-3d9e-47cc-96d7-779e54946e39 | |
VendorId: 0x0bda (0BDA) | |
ProductId: 0x0169 (0169) | |
Revision: 97.35 (9735) | |
Port: 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
""" | |
modified for Python 2.7 and unicode | |
get your goup id at https://lookup-id.com/ | |
get your acess token at https://developers.facebook.com/tools/explorer/ | |
fork from | |
fbfeed2csv: a tool to download all posts from a user/group/page's facebook feed to a csv file | |
yuzawa-san | |
https://github.com/yuzawa-san | |
""" |
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
1. 編輯你的fullchain.pem vim /etc/letsencrypt/live/blaha.tw/fullchain.pem | |
2. 把這個intermediate certificate(https://letsencrypt.org/certs/letsencryptauthorityx1.pem.txt)加入fullchain的兩個certificate中間 | |
3. restart你的webserver |
There are three easy to make mistakes in go. I present them here in the way they are often found in the wild, not in the way that is easiest to understand.
All three of these mistakes have been made in Kubernetes code, getting past code review at least once each that I know of.
- Loop variables are scoped outside the loop.
What do these lines do? Make predictions and then scroll down.
func print(pi *int) { fmt.Println(*pi) }
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
NSURL *url = [NSURL URLWithString:@"http://opendata.dot.taipei.gov.tw/opendata/alldescriptions.json"]; | |
NSURLRequest *request = [NSURLRequest requestWithURL:url]; | |
[NSURLConnection sendAsynchronousRequest:request | |
queue:[NSOperationQueue mainQueue] | |
completionHandler:^(NSURLResponse *response, NSData *data, NSError *connectionError) { | |
unsigned long big5 = CFStringConvertEncodingToNSStringEncoding(kCFStringEncodingBig5_HKSCS_1999); | |
NSString *json = [[NSString alloc] initWithData:data encoding:big5]; | |
NSError *error; | |
NSDictionary *dictionary = | |
[NSJSONSerialization JSONObjectWithData:[json dataUsingEncoding:NSUTF8StringEncoding] |
NewerOlder