Skip to content

Instantly share code, notes, and snippets.

View crossjs's full-sized avatar
🎯
Focusing

李文富 crossjs

🎯
Focusing
View GitHub Profile
@crossjs
crossjs / Balsamiq Mockups keys.txt
Created October 10, 2019 03:22 — forked from WahidurRahman7/Balsamiq Mockups keys.txt
Balsamiq Mockups keys for Windows and Mac
Name: Joseph
eJzzzU/OLi0odstPdypNr6rxyi9OLcioMTIysDQwNjIwMKhxNgSSABE9DGo=
Name: fb.com/josephgahm
eJzzzU/OLi0odstPdypNr6pJS9JLzs/Vz8ovTi3ISE/MyK0xMjKwNDA2MjAwqHE2BJIAyuUQiw==
Name: joseph graham
eJzzzU/OLi0odstPdypNr6rJyi9OLchQSC9KzEjMrTEyMrA0MDYyMDCocTYEkgCFYA8a
@crossjs
crossjs / Mac OS X: Open in Visual Studio Code
Created October 23, 2018 15:21 — forked from tonysneed/Mac OS X: Open in Visual Studio Code
Add a command to Finder services in Mac OSX to open a folder in VS Code
- Open Automator
- File -> New -> Service
- Change "Service Receives" to "files or folders" in "Finder"
- Add a "Run Shell Script" action
- Change "Pass input" to "as arguments"
- Paste the following in the shell script box: open -n -b "com.microsoft.VSCode" --args "$*"
- Save it as something like "Open in Visual Studio Code"
@crossjs
crossjs / what-forces-layout.md
Created December 30, 2016 14:25 — forked from paulirish/what-forces-layout.md
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Element

Box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
  • elem.clientLeft, elem.clientTop, elem.clientWidth, elem.clientHeight
  • elem.getClientRects(), elem.getBoundingClientRect()
@crossjs
crossjs / gist:fdbbedd25b8d55fc589c
Created March 11, 2016 05:31 — forked from vladimirtsyupko/gist:10964772
Git force pull to overwrite local files
git fetch --all
git reset --hard origin/master
git pull origin master
@crossjs
crossjs / WebStorage.js
Created December 9, 2015 16:12 — forked from heyimalex/WebStorage.js
localStorage sync with redux
export default class WebStorage {
constructor(key, storageArea = window.localStorage) {
this.key = key;
this.storageArea = storageArea;
}
load(defaultValue) {
const serialized = this.storageArea.getItem(this.key);
return serialized === null ? defaultValue : this.deserialize(serialized);
}