Skip to content

Instantly share code, notes, and snippets.

一波不是一波 riskers

Block or report user

Report or block riskers

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@PCreations
PCreations / rxjs-diagrams.md
Last active Oct 29, 2019
Super Intuitive Interactive Diagrams to learn combining RxJS sequences by Max NgWizard K
@wangcaipang
wangcaipang / diff.js
Created May 26, 2017
react diff patch
View diff.js
export default function diff (parentNode, prevNodeMap, newNodeMap) {
let lastIndex = 0
let lastRightNode = null
let patch = []
let mountIndex = 0
for (let name in newNodeMap) {
if (newNodeMap.hasOwnProperty(name)) {
let newNode = newNodeMap[name]
let prevNode = prevNodeMap[name]
if (prevNode) {
View docker-ops.md

stop all containers:

docker kill $(docker ps -q)

remove all containers

docker rm $(docker ps -a -q)

remove all docker images

@subfuzion
subfuzion / curl.md
Last active Nov 15, 2019
curl POST examples
View curl.md

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

View iOS 技能图谱.md

编程语言

  • Swift
  • Objective-C
  • C++/C
  • JavaScript

操作系统

  • Mac OSX
  • iOS
View 5 minute local Kubernetes Cluster on Mac
# Reference:
https://www.cloudgear.net/blog/2015/5-minutes-kubernetes-setup/
# install homebrew and cask
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# install virtualbox
brew cask install virtualbox
# install dockertoolbox
@mauriciosoares
mauriciosoares / doubleclick.js
Created Oct 19, 2015
rxjs double click example
View doubleclick.js
let clickStream = Rx.Observable.fromEvent(document.getElementById('link'), 'click');
clickStream
.buffer(clickStream.debounce(250))
.map(list => list.length)
.filter(x => x === 2)
.subscribe(() => {
console.log('doubleclick');
})
@paulirish
paulirish / what-forces-layout.md
Last active Nov 14, 2019
What forces layout/reflow. The comprehensive list.
View what-forces-layout.md

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()
@vvgomes
vvgomes / foo.js
Last active Nov 2, 2019
Ramda vs Lodash
View foo.js
var _ = require("lodash");
var R = require("ramda");
var companies = [
{ name: "tw", since: 1993 },
{ name: "pucrs", since: 1930 },
{ name: "tw br", since: 2009 }
];
var r1 = _(companies).chain()
@paulwellnerbou
paulwellnerbou / GitLogBetween.java
Created Jun 18, 2015
Getting git log between commits, branches and annotated tags with JGit
View GitLogBetween.java
package de.wellnerbou.gitjira.jgit;
import org.eclipse.jgit.api.Git;
import org.eclipse.jgit.api.errors.GitAPIException;
import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.Ref;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.revwalk.RevCommit;
import java.io.IOException;
You can’t perform that action at this time.