Skip to content

Instantly share code, notes, and snippets.

View XingMXTeam's full-sized avatar
🏠
Working from home

毛毛星 XingMXTeam

🏠
Working from home
View GitHub Profile
@XingMXTeam
XingMXTeam / iterm2.md
Created February 14, 2019 14:29 — forked from squarism/iterm2.md
iterm2 cheatsheet

Tabs and Windows

Function Shortcut
New Tab + T
Close Tab or Window + W (same as many mac apps)
Go to Tab + Number Key (ie: ⌘2 is 2nd tab)
Go to Split Pane by Direction + Option + Arrow Key
Cycle iTerm Windows + backtick (true of all mac apps and works with desktops/mission control)
class Filters extends React.Component {
// updatePriceFilter = (newValue) => {
// this.props.selectionsChanged({
// ...this.props.filterSelections,
// price: newValue
// })
// };
//
// updateAgeFilter = (newValue) => {
// URL: http://a.com/foo
var win = window.open('http://b.com/bar');
win.postMessage('Hello, bar!', 'http://b.com');
// URL: http://b.com/bar
window.addEventListener('message',function(event) {
console.log(event.data);
});
// a.com
navigation.onData(){
// 数据到达的处理函数
}
typeof navigation.getData === 'function'
|| navigation.getData()
// b.com
navigation.getData = function(){
//1
var xhr = new XMLHttpRequest();
xhr.open('GET', url);
xhr.withCredentials = true;
xhr.send();
//2
$.ajax({
url: a_cross_domain_url,
xhrFields: {
// 导出对象
export { firstname, lastname };
// 导出变量
export const firstname = 'robin';
export const lastname = 'wieruch';
// 导入整个模块
import * as myModule from "xxx";
@XingMXTeam
XingMXTeam / spliceOne.js
Last active April 16, 2018 12:50
another Array.splice implement which is 1.5x faster
function spliceOne(list, index) {
for (var i = index, k = i + 1, n = list.length; k < n; i += 1, k += 1)
list[i] = list[k];
list.pop();
}
/* 高斯模糊层UI样式 */
.mw-course-learn-blur-image-layer {
width: 100%;
&_img {
width: 100%;
overflow: hidden;
height: rem(422px);
font-size: 0;
-webkit-filter: blur(2px);
filter: blur(2px);
@XingMXTeam
XingMXTeam / module.js
Created August 16, 2017 06:04
create module
//1 best
var module = {
prop: true,
method: function(){
}
}
//2
var module2 = (function() {
var privateProp;
@XingMXTeam
XingMXTeam / module.js
Created August 16, 2017 06:03
create module
//ModuleA是模块名字
(function(){
// var ModuleA = {
// }
// var ModuleA = function() {
// return function() {