Skip to content

Instantly share code, notes, and snippets.

@andretw
andretw / android-masking-network-operator.sh
Last active November 22, 2017 08:15 — forked from rashidi/android-masking-network-operator.sh
Android - Masking Network Operator
# Settings -> Applications -> Manage Applications -> Market -> Clear Cache -> Force Stop (this button will be enabled if your Market is still running) -> OK
# Open a console and type the following command (for *nix user, remember to use sudo to avoid permission error):
adb shell setprop gsm.sim.operator.numeric 46692
adb shell setprop gsm.operator.numeric 46692
adb shell setprop gsm.sim.operator.iso-country tw
adb shell setprop gsm.operator.iso-country tw
<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>SignatureDoesNotMatch</Code>
<Message>The request signature we calculated does not match the signature you provided. Check your key and signing method.</Message>
<StringToSignBytes>33 44 55 blah blah blah ...</StringToSignBytes>
<RequestId>F7A8F1659DE5909C</RequestId>
<HostId>retgfdg352343243-23498i4859034=s9fd!ewr98e590f</HostId>
<StringToSign>PUT
image/png
123456788
@andretw
andretw / ReactJSSnippet.txt
Last active November 25, 2016 18:42
[Stack overflow] ReactJS snippet
<!-- begin snippet: js hide: false console: true babel: true -->
<!-- language: lang-js -->
class Example extends React.Component {
constructor() {
super();
this.state = {
v: {
}
@andretw
andretw / actions-another.js
Last active August 1, 2016 17:20
reactjs-redux-change-state-in-action-creator-or-reducer-another
import * as ACTION_TYPES from '../constants/action-types'
const action = (type, payload = {}) => ({ type, payload })
const getUsernameSuccess = username =>
action(
ACTION_TYPES.GET_USERNAME_SUCCESS, {
username,
message: 'Anything you want to show here.',
}
@andretw
andretw / actions.js
Last active August 1, 2016 17:20
reactjs-redux-change-state-in-action-creator-or-reducer
import * as ACTION_TYPES from '../constants/action-types'
const action = (type, payload = {}) => ({ type, payload })
const getUsernameSuccess = username =>
action(
ACTION_TYPES.GET_USERNAME_SUCCESS, {
username,
}
)
@andretw
andretw / ipv6.coffee
Created December 30, 2014 02:54
Check if the IP is IPv6 or not. (Using uri.js)
isIpv6 = (ip) ->
uri = new URI("http://#{ip}")
result = uri.is("ipv6")
$log.debug "check ip #{ip} is ipv6 or not: #{result}"
return result

It's my memo of using gulp.

npm install gulp

if package.json exists

npm install -l
@andretw
andretw / notes_of_docker.md
Last active August 29, 2015 14:11
Docker

Remember to get the latest boot2docker and docker!

install

brew install boot2docker
brew install docker

create container

docker pull centos

The Reactive Manifesto 反應式宣言

Published on September 16 2014. (v2.0) 發佈於 2014 年 9 月 16 日 (v2.0)

Organisations working in disparate domains are independently discovering patterns for building software that look the same. These systems are more robust, more resilient, more flexible and better positioned to meet modern demands.

These changes are happening because application requirements have changed dramatically in recent years. Only a few years ago a large application had tens of servers, seconds of response time, hours of offline maintenance and gigabytes of data. Today applications are deployed on everything from mobile devices to cloud-based clusters running thousands of multi-core processors. Users expect millisecond response times and 100% uptime. Data is measured in Petabytes. Today's demands are simply not met by yesterday’s software architectures.

We believe that a coherent approach to systems architecture is needed, and we believe that all necessary aspects are already recognised individually

Two ways for getting new libraries:

  • Download source tarballs from public PyPI server.
pip install --download=. PACKAGE_NAME
  • Build source tarballs from local
python setup.py sdist