Skip to content

Instantly share code, notes, and snippets.

andyyou /
Created February 10, 2023 07:19 — forked from pydevops/
Example Cloud Armor policies protecting Google HTTPS Global Load Balancer in front of GCE instance group and GKE cluster
#!/usr/bin/env bash
# REF:
# REF:
# REF:
# REF:
# REF:
export PROJECT_ID=$(gcloud config get-value project)
export PROJECT_USER=$(gcloud config get-value core/account) # set current user



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 / upload.js
Created April 15, 2016 00:23 — forked from claudiopetrini/node_upload.js
Node.js file upload on Stamplay
View upload.js
'use strict';
const request = require('request');
const fs = require('fs');
var formData = {
image: fs.createReadStream(__dirname + '/claudio.jpg'),
andyyou /
Created December 14, 2015 07:52 — forked from brentvatne/
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
View Few Line of Hack Code Make React-Native Run on

#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:

andyyou /
Created September 30, 2015 13:58 — forked from kevin-smets/
iTerm2 + oh my zsh + solarized + Meslo powerline font (OSX)

All binary can be downloaded

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

0xe21b3 85 3B


andyyou / fix_homebrew.rb
Created September 24, 2015 01:11 — forked from rpavlik/fix_homebrew.rb
Fix permissions on /usr/local for Homebrew
View fix_homebrew.rb
# 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