Skip to content

Instantly share code, notes, and snippets.

@thinkgarden
thinkgarden / vscode.json
Created July 25, 2018 03:17
settings backup
// Place your settings in this file to overwrite the default settings
{
// The number of spaces a tab is equal to. This setting is overriden based on the file contents when `editor.detectIndentation` is on.
"editor.tabSize": 2,
// Format a file on save. A formatter must be available, the file must not be auto-saved, and editor must not be shutting down.
"editor.formatOnSave": true,
// Controls whether the editor should render indent guides
"editor.renderIndentGuides": true,
// TypeScript
// Defines space handling after function keyword for anonymous functions
function drawLayer02Label(canvasObj, text, textBeginX, lineEndX) {
var colorValue = '#04918B';
var ctx = canvasObj.getContext("2d");
ctx.beginPath();
ctx.arc(35, 55, 2, 0, 2 * Math.PI);
ctx.closePath();
ctx.fillStyle = colorValue;
ctx.fill();
ctx.moveTo(35, 55);
ctx.lineTo(60, 80);
@thinkgarden
thinkgarden / react-native.md
Created July 23, 2018 07:59
[react-native]

全局错误处理

/* eslint-disable */
import { setGlobalHandler } from 'ErrorUtils';
/* eslint-enable */


setGlobalHandler((error) => console.warn(error)); // eslint-disable-line
@thinkgarden
thinkgarden / android.md
Last active October 24, 2020 04:13
[android] android build config

adb 常用命令

adb connect [ip]:[port] 连接机顶盒(默认端口为5555)

adb devices 查看所有连接设备 名称、ip、端口已经状态( device 或 offline )

adb install [apk 安装包所在路径(如:d:\a.apk)] 将对应路径的 apk 安装包安装到机顶盒

adb install -r [apk 安装包所在路径(如:d:\a.apk)] 将对应路径的apk 安装包强制(覆盖)安装到机顶盒

adb -s [设备名称或设备IP:端口] install [apk 安装包所在路径(如:d:/a.apk)] 当 adb 连接多个设备时,将 apk 安装到指定设备中

@thinkgarden
thinkgarden / cmd.md
Last active September 7, 2018 05:47
[command line]

set remote url

git remote set-url origin git://new.url.here

mac 显示隐藏文件

defaults write com.apple.finder AppleShowAllFiles -boolean true ; 
killall Finder
@thinkgarden
thinkgarden / saga.html
Created July 8, 2018 04:07
[little saga] some concept for saga
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8"></meta>
<meta
name="viewport"
content="width=device-width, initial-scale=1.0"
></meta>
@thinkgarden
thinkgarden / RNStings.md
Created June 15, 2018 02:20
[React Native Settings] The Basic settings of React Native

React Native Settings

Init a Project

$ react-native init --help
Usage: react-native init <ProjectName> [--verbose]
Eg: react-native init --version="0.36.0" MyNewApp
@thinkgarden
thinkgarden / iphoneX.md
Last active June 14, 2018 01:32
[iphoneX.css]

搜索关键词 iphone X fixed bottom

第一步:设置网页在可视窗口的布局方式

  • 新增 viewport-fit 属性,使得页面内容完全覆盖整个窗口:
<meta name="viewport" content="width=device-width, viewport-fit=cover">
@thinkgarden
thinkgarden / generate.js
Last active July 8, 2018 04:00
[generate] some sample for generate
function *foo() {
var x = yield 2;
z++;
var y = yield (x * z);
console.log( x, y, z );
}
var z = 1;
var it1 = foo();
var it2 = foo();