Skip to content

Instantly share code, notes, and snippets.

@andyyou
andyyou / gke-gce-cloud-armor-lb.sh
Created February 10, 2023 07:19 — forked from pydevops/gke-gce-cloud-armor-lb.sh
Example Cloud Armor policies protecting Google HTTPS Global Load Balancer in front of GCE instance group and GKE cluster
#!/usr/bin/env bash
# REF: https://cloud.google.com/armor/docs/integrating-cloud-armor#with_ingress
# REF: https://cloud.google.com/armor/docs/configure-security-policies
# REF: https://cloud.google.com/iap/docs/load-balancer-howto
# REF: https://cloud.google.com/sdk/gcloud/reference/compute/url-maps/add-path-matcher
# REF: https://cloud.google.com/load-balancing/docs/https/setting-up-url-rewrite
export PROJECT_ID=$(gcloud config get-value project)
export PROJECT_USER=$(gcloud config get-value core/account) # set current user
@andyyou
andyyou / iterm2-solarized.md
Created September 30, 2015 13:58 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + oh my zsh + solarized + Meslo powerline font (OSX)

Solarized

Strings

String.prototype.*

None of the string methods modify this – they always return fresh strings.

  • charAt(pos: number): string ES1

    Returns the character at index pos, as a string (JavaScript does not have a datatype for characters). str[i] is equivalent to str.charAt(i) and more concise (caveat: may not work on old engines).

@andyyou
andyyou / upload.js
Created April 15, 2016 00:23 — forked from claudiopetrini/node_upload.js
Node.js file upload on Stamplay
'use strict';
const request = require('request');
const fs = require('fs');
var formData = {
image: fs.createReadStream(__dirname + '/claudio.jpg'),
};
request.post({
@andyyou
andyyou / contest.md
Created December 14, 2015 07:52 — forked from brentvatne/contest.md
React.js Conf Contest

React.js Conf tickets, everyone wants them but we only have space for 400 people, and that includes speakers, organizers and everyone’s proud parents and grandparents! If you are into speaking and have time before December 13th, you should submit a 30 minute talk or 5 minute lightning talk proposal. If you’re more into writing than speaking or coding, ReactJSNews is giving away 1 ticket for the best blog post submission. But you probably like programming, so React Native Newsletter & Exponent are giving away two tickets for the best React Native apps made with Exponent! Of course, if you like speaking, writing and programming you should do all of the above.

Details of the contest

  • You make an “app” and publish it to Exponent. You don’t have to open source it, but people

#Few Line of Hack Code Make React-Native Run on Windows

While React-Native just add support of Android,yet officeally they just only support on OSX.

After a few hours of debugging, I find a simple way of let React-Native run on Windows.

Make sure all requirements were all setup following this:

Then initilize the project following this:

All binary can be downloaded http://pan.baidu.com/s/1hqH2Pko

Sublime Text 3, build 3083 (dev) for Windows x64

OFFSET ORIGINAL CRACKED
0xe21b3 85 3B

md5:c3522c719d24f85dd770c93b9bf9e56f

@andyyou
andyyou / fix_homebrew.rb
Created September 24, 2015 01:11 — forked from rpavlik/fix_homebrew.rb
Fix permissions on /usr/local for Homebrew
#!/usr/bin/ruby
#
# This script fixes /usr/local only.
#
# 6th January 2010:
# Modified the script to just fix, rather than install. - rpavlik
#
# 30th March 2010:
# Added a check to make sure user is in the staff group. This was a problem
# for me, and I think it was due to me migrating my account over several