Skip to content

Instantly share code, notes, and snippets.

View harriswan9a's full-sized avatar

harriswan9a

  • Taichung City, Taiwan (R.O.C.)
View GitHub Profile
@harriswan9a
harriswan9a / README.md
Created December 2, 2017 23:58 — forked from polbins/README.md
Android Studio as default Git Diff Tool

Create Android Studio Command-line Launcher

  1. Open Android Studio
  2. Go to: Tools > Create Command-line Launcher
  3. Leave as default, Press OK

Configure Git to use Android Studio as default Diff Tool

  1. Add the following lines to your .gitconfig
// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible).
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export.
var FORMAT_ONELINE = 'One-line';
var FORMAT_MULTILINE = 'Multi-line';
var FORMAT_PRETTY = 'Pretty';
var LANGUAGE_JS = 'JavaScript';
var LANGUAGE_PYTHON = 'Python';
@harriswan9a
harriswan9a / pullJSON.js
Created March 16, 2017 15:21 — forked from varun-raj/pullJSON.js
Google App Script To Fetch Data From JSON Webservice and Write them to google spreadsheet.
function pullJSON() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheets = ss.getSheets();
var sheet = ss.getActiveSheet();
var url="http://example.com/feeds?type=json"; // Paste your JSON URL here
var response = UrlFetchApp.fetch(url); // get feed
var dataAll = JSON.parse(response.getContentText()); //
@harriswan9a
harriswan9a / Readme.md
Created January 5, 2017 09:45 — forked from andrey-skl/Readme.md
How to compile and run react-native application from terminal

To run on ios:

  1. Install XCode (recommended) or XCode command line tools by xcode-select --install
  2. Into XCode settings, go to "Downloads" tab and download iOS 9.2 emulator
  3. Compile native app and run it on simulator via npm run ios

To run on Android:

  1. Set up Android environment
  2. Create emulator via npm run android-emulator-create
  3. Run emulator via npm run android-emulator
  4. Compile native code and run it on emulator via npm run android
@harriswan9a
harriswan9a / build.gradle
Last active December 19, 2016 07:58
react-native-cli:1.0.0 、 react-native:0.39.2 generate android project can't use --configuration Release
apply plugin: "com.android.application"
import com.android.build.OutputFile
/**
* The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
* and bundleReleaseJsAndAssets).
* These basically call `react-native bundle` with the correct arguments during the Android build
* cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
* bundle directly from the development server. Below you can see all the possible configurations
@harriswan9a
harriswan9a / AppDelegate.swift
Created February 20, 2016 01:39 — forked from sawapi/AppDelegate.swift
[Swift] Push Notification
//
// AppDelegate.swift
// pushtest
//
// Created by sawapi on 2014/06/08.
// Copyright (c) 2014年 sawapi. All rights reserved.
//
// iOS8用
import UIKit
// 開啟Browser
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("http://tw.yahoo.com"));
startActivity(intent);
// 開啟YoutubeApp
// https://www.youtube.com/watch?v=2hhc6Zqn1GU
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("vnd.youtube:" + DEF_VIDEO_ID));
startActivity(intent);