Skip to content

Instantly share code, notes, and snippets.

View twlz0ne's full-sized avatar

twlz0ne

  • Fuzhou, China
View GitHub Profile
@twlz0ne
twlz0ne / flutter_desktop_macos.md
Created May 25, 2019 06:42 — forked from ajinasokan/flutter_desktop_macos.md
Run Flutter apps in MacOS with IDE support and hot reloading

This setup is only for MacOS. I don't have a windows/linux machine to test.

Clone FDE repo

cd ~
git clone https://github.com/google/flutter-desktop-embedding

Switch to flutter master

@twlz0ne
twlz0ne / gist:1719b66455e5efd110be0ccb925e5fbb
Created May 12, 2019 16:13 — forked from rtrouton/gist:2ca6f001b3cecb5037825c7f9d2e422e
Xcode iOS simulator download URLs (as of Xcode 8.3.1)
iOS 10.2 Simulator: https://devimages-cdn.apple.com/downloads/xcode/simulators/com.apple.pkg.iPhoneSimulatorSDK10_2-10.2.1.1484185528.dmg
iOS 10.1 Simulator: https://devimages-cdn.apple.com/downloads/xcode/simulators/com.apple.pkg.iPhoneSimulatorSDK10_1-10.1.1.1476902849.dmg
iOS 10.0 Simulator: https://devimages-cdn.apple.com/downloads/xcode/simulators/com.apple.pkg.iPhoneSimulatorSDK10_0-10.0.1.1474488730.dmg
iOS 9.3 Simulator: https://devimages.apple.com.edgekey.net/downloads/xcode/simulators/com.apple.pkg.iPhoneSimulatorSDK9_3-9.3.1.1460411551.dmg
iOS 9.2 Simulator: https://devimages.apple.com.edgekey.net/downloads/xcode/simulators/com.apple.pkg.iPhoneSimulatorSDK9_2-9.2.1.1451951473.dmg
iOS 9.1 Simulator: https://devimages.apple.com.edgekey.net/downloads/xcode/simulators/com.apple.pkg.iPhoneSimulatorSDK9_1-9.1.1.1446593668.dmg
iOS 9.0 Simulator: https://devimages.apple.com.edgekey.net/downloads/xcode/simulators/com.apple.pkg.iPhoneSimulatorSDK9_0-9.0.1.1443554484.dmg
iOS 8.4 Simulator: https://devimages.a
@twlz0ne
twlz0ne / test-with-emacs-v1.el
Created April 20, 2019 12:41
Start a #emacs in a subprocess, and execute expressions there.
;;; test-with-emacs-v1.el --- Test with-emacs v1 -*- lexical-binding: t; -*-
;; Author: gongqijian@gmail.com
;; Usage: emacs --batch -l ~/.scratch/emacs/test-with-emacs-v1.el -f ert-run-tests-batch-and-exit
;; Date: 2019/04/20
;;; Code:
(require 'ert)
(defmacro with-emacs (path &rest body)
;;; Usage: /path/to/emacs -nw -Q -l /path/to/test-lsp-find-clients.el
;;; Preset:
;;
;; mkdir ~/scratch/c-c++/test-lsp-{clangd,cquery}
;; touch ~/scratch/c-c++/test-lsp-{clangd,cquery}/main.cc
;; touch ~/scratch/c-c++/test-lsp-clangd/CLANGD
;; touch ~/scratch/c-c++/test-lsp-cquery/CQUERY
;;
;;; Date: 2019-04-02_20.20.27
(toggle-debug-on-error)
@twlz0ne
twlz0ne / benchmark-native-json.el
Created March 11, 2019 06:06
benchmark native and json.el #emacs
;;; Usage: /path/to/emacs -Q --batch -l /path/to/benchmark-native-json.el
;;; Date: 2019-03-10_15.53.34
(require 'json)
(defconst json-string
;; @from https://github.com/syohex/emacs-parson/blob/master/bench/bench.json
"{
\"glossary\": {
\"title\": \"example glossary\",
\"GlossDiv\": {
@twlz0ne
twlz0ne / init-hilight.el
Last active February 15, 2019 07:44
Extend symbol-overlay with hyrda and some extra functions #Emacs
;;; init-hilight.el --- Init hilight -*- lexical-binding: t; -*-
;; Copyright (C) 2019 Gong Qijian <gongqijian@gmail.com>
;; Author: Gong Qijian <gongqijian@gmail.com>
;; Created: 2019/02/15
;; Version: 0.1.0
;; Package-Requires: ((symbol-overlay "4.1") (hydra "0.14) (dash "2.0"))
;; Keywords: faces, matching
@twlz0ne
twlz0ne / init-web.el
Last active December 28, 2018 14:28
Init web with lsp, append major mode to existing lsp client #Emacs
;;; init-web.el --- Init web with lsp -*- lexical-binding: t; -*-
(require 'web)
(require 'lsp)
(require 'lsp-clients)
(defmacro lsp-register-major-mode (client mode)
"Registers major MODE to CLIENT.
\(fn 'example-ls 'example-mode)"
@twlz0ne
twlz0ne / test-lsp-typescript-issue535.el
Created October 24, 2018 15:27
Test lsp-typescript, reproduce issue that Error from the Language Server: Request textDocument/hover failed with message: Cannot read property ’map’ of undefined (Internal Error) [7996 times] #Emacs #lsp #typescript
;;; Test lsp-typescript, reproduce issue that Error from the Language Server: Request textDocument/hover failed with message: Cannot read property ’map’ of undefined (Internal Error) [7996 times]
;;; Usage: /path/to/emacs -nw -Q -l /path/to/test-lsp-typescript-issue535.el /path/to/Microsoft/TypeScriptSamples/angular2/app/todo.ts
;;; Date: 2018-10-24_22.25.12
(toggle-debug-on-error)
(global-set-key (kbd "C-h") 'delete-backward-char)
(global-set-key (kbd "M-h") 'backward-kill-word)
(global-set-key (kbd "<f1>") 'help-command)
(define-key isearch-mode-map "\C-h" 'isearch-delete-char)
@twlz0ne
twlz0ne / test-dart-mode-issue69.el
Last active December 8, 2018 13:35
Test dart-mode, reproduce the issue 69. #emacs #dart-mode
;;; Test dart-mode, reproduce the issue #69
;;
;;; Date: 2018-10-24_16.02.30
;;
;;; Enviroment
;; - macOS 10.11.6
;; - Emacs 27.0.50
;; - dart-mode-20181012.346
;; - dash-20180910.1856
;; - epl-20180205.2049
@twlz0ne
twlz0ne / test-eglot.el
Last active October 24, 2018 14:16
Reproduce issue that eglot hangs with message "[jsonrpc] (warning) Sentinel for EGLOT (~/c-mode) still hasn't run, deleting it!" #Emacs #LSP
;;; tset-eglot.el --- Test eglot -*- lexical-binding: t; -*-
;;; Date: 2018-09-11_11.46.58
;;; Commentary:
;;
;; Reproduce issue that eglot hangs with message "[jsonrpc] (warning) Sentinel for EGLOT (~/c-mode) still hasn't run, deleting it!"
;;
;;; Steps:
;;