Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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
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 / 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
@thinkgarden
thinkgarden / git.md
Last active February 5, 2020 09:52
[git]
@thinkgarden
thinkgarden / across.client.js
Created August 29, 2018 04:43 — forked from yueyuzhao/across.client.js
代理翻墙 (nodejs实现)
// 客户端实现
const net = require('net')
const tls = require('tls')
const localServer = new net.Server()
localServer.on('connection', (socket) => {
socket.pause()
const context = {
@thinkgarden
thinkgarden / HTML5 之图片上传预处理.md
Created September 4, 2018 03:45
[HTML5 之图片上传预处理]

获取图片

通过 File API 获取图片

var input = document.createElement('input');
input.type = 'file';
input.addEventListener('change', function(){
	var file = this.file[0];
})
@thinkgarden
thinkgarden / canvas.md
Created September 15, 2018 15:22
[canvas]

绘制基本图形

arc()方法
arc(x, y, radius, startRad, endRad, [anticlockwise]);

** 绘制圆和圆弧 **