Skip to content

Instantly share code, notes, and snippets.

View jamesyang124's full-sized avatar

James Yang jamesyang124

  • HTC
  • Richmond, California
View GitHub Profile
@jamesyang124
jamesyang124 / security_algorithms.md
Last active August 22, 2016 15:46
security algorithms for refactoring.
#####
# OS X temporary files that should never be committed
.DS_Store
*.swp
*.lock
profile
#####
# DotEnv files
.env
@jamesyang124
jamesyang124 / .gitignore
Created July 30, 2016 05:12 — forked from adamgit/.gitignore
.gitignore file for Xcode4 / OS X Source projects
#########################
# .gitignore file for Xcode4 and Xcode5 Source projects
#
# Apple bugs, waiting for Apple to fix/respond:
#
# 15564624 - what does the xccheckout file in Xcode5 do? Where's the documentation?
#
# Version 2.6
# For latest version, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects
#
@jamesyang124
jamesyang124 / twjug_04_15_2016.md
Last active April 16, 2016 16:32
digest of the topic: Event Sourcing and Microservices.

Event Sourcing and Microservices

talked by Ralph Winzinger


###Microservices I
  • fault-tolerant /resilient

> through docker or other container services to supoprt backup/restore/launch-up when an instance is down.

Memory Management and Performance

JavaScript engines such as Google’s V8 (Chrome, Node) are specifically designed for the fast execution of large JavaScript applications. As you develop, if you care about memory usage and performance, you should be aware of some of what’s going on in your user’s browser’s JavaScript engine behind the scenes.

Continue reading Writing Fast, Memory-Efficient JavaScript, great general overview of a Google employee

Videos

@jamesyang124
jamesyang124 / gist:03e8711093c97c185ca5
Created March 2, 2016 03:14 — forked from jessedearing/gist:2351836
Create self-signed SSL certificate for Nginx
#!/bin/bash
echo "Generating an SSL private key to sign your certificate..."
openssl genrsa -des3 -out myssl.key 1024
echo "Generating a Certificate Signing Request..."
openssl req -new -key myssl.key -out myssl.csr
echo "Removing passphrase from key (for nginx)..."
cp myssl.key myssl.key.org
openssl rsa -in myssl.key.org -out myssl.key

Content Search

  • ack/ag, examples:
ag strings [path|files] --ignore="*.yml" --ignore="*.js.coffee"

# search readme at end of line
ag readme$
@jamesyang124
jamesyang124 / gist:246ba6a1e455b13370e0
Created February 18, 2016 03:10 — forked from perusio/gist:1326701
Mobile device detection in Nginx with just 7 lines of configuration
### Testing if the client is a mobile or a desktop.
### The selection is based on the usual UA strings for desktop browsers.
## Testing a user agent using a method that reverts the logic of the
## UA detection. Inspired by notnotmobile.appspot.com.
map $http_user_agent $is_desktop {
default 0;
~*linux.*android|windows\s+(?:ce|phone) 0; # exceptions to the rule
~*spider|crawl|slurp|bot 1; # bots
~*windows|linux|os\s+x\s*[\d\._]+|solaris|bsd 1; # OSes
@jamesyang124
jamesyang124 / review_rfc6265.md
Last active May 22, 2022 18:52
Quick review of RFC6265 - HTTP State Management Mechanism https://tools.ietf.org/html/rfc6265

HTTP State Management Mechanism

Syntax Example

  • Origin servers SHOULD NOT fold multiple Set-Cookie header fields into a single header field. The usual mechanism for folding HTTP headers fields (i.e., as defined in [RFC2616]) might change the semantics of the Set-Cookie header field because the %x2C (",") character is used by Set-Cookie in a way that conflicts with such folding.