Command | Description |
---|---|
Ctrl + a | To the beginning of the line |
Ctrl + e | To the end of the line |
Alt + b | One word back |
Alt + f | One word forward |
Ctrl + k | Delete to the end of the line |
Ctrl + u | Delete to the beginning of the line |
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
# ---------------------------------------------------------------------- | |
# Expires headers (for better cache control) | |
# ---------------------------------------------------------------------- | |
# These are pretty far-future expires headers. | |
# They assume you control versioning with filename-based cache busting | |
# Additionally, consider that outdated proxies may miscache | |
# www.stevesouders.com/blog/2008/08/23/revving-filenames-dont-use-querystring/ | |
# If you don't use filenames to version, lower the CSS and JS to something like |
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
// YELIN MONGO UTILS | |
// get index usage | |
db.orders.aggregate( [ { $indexStats: { } } ] ) | |
// find connection status | |
ar status = db.serverStatus() | |
status.connections | |
// kill operations taking longer than 5s |
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
import time | |
import asyncio | |
import logging | |
import aiohttp | |
logging.basicConfig( | |
format='%(asctime)s %(levelname)-8s %(message)s', | |
level=logging.INFO, | |
datefmt='%Y-%m-%d %H:%M:%S') |
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
apiVersion: autoscaling/v2beta1 | |
kind: HorizontalPodAutoscaler | |
metadata: | |
name: my-hpa | |
namespace: sg-prod | |
annotations: | |
metric-config.object.istio-requests-total.prometheus/per-replica: "true" | |
metric-config.object.istio-requests-total.prometheus/query: | | |
sum(rate(istio_requests_total{reporter="destination", destination_workload="<deployment-name-here>"}[2m])) | |
spec: |
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 | |
NAME=$1 | |
HOST=$2 | |
PORT=$3 | |
if [ -z "$3" ]; then | |
echo "$0 [name] [ip] [port]" | |
exit 1 | |
fi |
This tutorial was created by Shopify for internal purposes. We've created a public version of it since we think it's useful to anyone creating a GraphQL API.
It's based on lessons learned from creating and evolving production schemas at Shopify over almost 3 years. The tutorial has evolved and will continue to change in the future so nothing is set in stone.
I hereby claim:
- I am yelinaung on github.
- I am yelinaung (https://keybase.io/yelinaung) on keybase.
- I have a public key ASATtA1d5QNT3Nu0q73LRZiQLFrmVi5vgAfbNdqvaZeiBwo
To claim this, I am signing this object:
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)
That's it!
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 "fmt" | |
import "unicode/utf8" | |
func main() { | |
str1 := "ခ" | |
str2 := "a" | |
str3 := "界" |
NewerOlder