Skip to content

Instantly share code, notes, and snippets.

View flyfloor's full-sized avatar
🎯
Focusing

jerry flyfloor

🎯
Focusing
View GitHub Profile
@flyfloor
flyfloor / gist:cb77ecc39fd698553fd0fa29a3dce261
Created November 20, 2017 08:16
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
xcode-select --install
(function(){var UA=navigator.userAgent,isAndroid=/android|adr/gi.test(UA),isIos=/iphone|ipod|ipad/gi.test(UA)&&!isAndroid,isMobile=isAndroid||isIos;var docEl=document.documentElement,maxwidth=docEl.dataset.mw||750,dpr=isIos?Math.min(window.devicePixelRatio,3):1,scale=1/dpr,tid;docEl.removeAttribute("data-mw");docEl.dataset.dpr=dpr;metaEl=document.createElement("meta");metaEl.name="viewport";metaEl.content=fillScale(scale);docEl.firstElementChild.appendChild(metaEl);var refreshRem=function(){var width=docEl.getBoundingClientRect().width;if(width/dpr>maxwidth){width=maxwidth*dpr}var rem=width/16*2.2;docEl.style.fontSize=rem+"px"};window.addEventListener("resize",function(){clearTimeout(tid);tid=setTimeout(refreshRem,300)},false);window.addEventListener("pageshow",function(e){if(e.persisted){clearTimeout(tid);tid=setTimeout(refreshRem,300)}},false);function fillScale(scale){return"width=device-width,initial-scale="+scale+",maximum-scale="+scale+",minimum-scale="+scale}refreshRem()})();
(function(){var UA=navigator.userAgent,isAndroid=/android|adr/gi.test(UA),isIos=/iphone|ipod|ipad/gi.test(UA)&&!isAndroid,isMobile=isAndroid||isIos;var docEl=document.documentElement,maxwidth=docEl.dataset.mw||750,dpr=isIos?Math.min(window.devicePixelRatio,3):1,scale=1/dpr,tid;docEl.removeAttribute("data-mw");docEl.dataset.dpr=dpr;metaEl=document.createElement("meta");metaEl.name="viewport";metaEl.content=fillScale(scale);docEl.firstElementChild.appendChild(metaEl);var refreshRem=function(){var width=docEl.getBoundingClientRect().width;if(width/dpr>maxwidth){width=maxwidth*dpr}var rem=width/16*2.2;docEl.style.fontSize=rem+"px"};window.addEventListener("resize",function(){clearTimeout(tid);tid=setTimeout(refreshRem,300)},false);window.addEventListener("pageshow",function(e){if(e.persisted){clearTimeout(tid);tid=setTimeout(refreshRem,300)}},false);function fillScale(scale){return"width=device-width,initial-scale="+scale+",maximum-scale="+scale+",minimum-scale="+scale}refreshRem()})();
@flyfloor
flyfloor / # Sublime Emmet JSX Reactjs.md
Created September 5, 2016 02:59 — forked from max-mykhailenko/# Sublime Emmet JSX Reactjs.md
Sublime text 3. Enable Emmet in JSX files with Sublime React plugin

This is no longer needed as Emmet supports JSX - you just need to turn it all on. Did a quick tutorial: http://wesbos.com/emmet-react-jsx-sublime/

Thanks, @wesbos

Problem

  • Using emmet in jsx files
  • Emmet expands text when js autocomplete needed
@flyfloor
flyfloor / promises.md
Created September 5, 2016 02:58 — forked from domenic/promises.md
You're Missing the Point of Promises

This article has been given a more permanent home on my blog. Also, since it was first written, the development of the Promises/A+ specification has made the original emphasis on Promises/A seem somewhat outdated.

You're Missing the Point of Promises

Promises are a software abstraction that makes working with asynchronous operations much more pleasant. In the most basic definition, your code will move from continuation-passing style:

getTweetsFor("domenic", function (err, results) {
 // the rest of your code goes here.
@flyfloor
flyfloor / audio_tag.rb
Created September 5, 2016 02:58 — forked from HKLF4/audio_tag.rb
Octopress HTML5 Audio Tag
# Title:
# Octopress HTML5 Audio Tag
# http://antoncherkasov.me/projects/octopress-plugins
# Author:
# Anton Cherkasov
# http://antoncherkasov.me
# antoncherkasov@me.com
# Syntax:
# {% audio url/to/mp3 %}
# {% audio url/to/mp3 url/to/ogg %}
@flyfloor
flyfloor / gist:5ebc3cbeb1c89438444e9582748c175b
Created September 5, 2016 02:58
alfred use iterm2 as default terminal
-- This is v0.6 of the custom script for AlfredApp for iTerm 2.9+
-- Please see https://github.com/stuartcryan/custom-iterm-applescripts-for-alfred/
-- for the latest changes.
-- Please note, if you store the iTerm binary in any other location than the Applications Folder
-- please ensure you update the two locations below (in the format of : rather than / for folder dividers)
-- this gets around issues with AppleScript not handling things well if you have two iTerm binaries on your system... which can happen :D
on alfred_script(q)
if application "iTerm2" is running or application "iTerm" is running then
defaults write com.apple.dock autohide-time-modifier -float 0.15;killall Dock
error:
[!] Unable to add a source with url `https://github.com/CocoaPods/Specs.git` named `master`.
You can try adding it manually in `~/.cocoapods/repos` or via `pod repo add`.
sloved:
cd ~/.cocoapods/repos
git clone https://github.com/CocoaPods/Specs.git
@flyfloor
flyfloor / default.custom.yaml
Created May 28, 2016 08:59 — forked from lotem/default.custom.yaml
在Rime輸入方案選單中添加五筆、雙拼、粵拼、注音,保留你需要的
# default.custom.yaml
# save it to:
# ~/.config/ibus/rime (linux)
# ~/Library/Rime (macos)
# %APPDATA%\Rime (windows)
patch:
schema_list:
- schema: luna_pinyin # 朙月拼音
- schema: luna_pinyin_simp # 朙月拼音 简化字模式