Skip to content

Instantly share code, notes, and snippets.

/* global window */
function StageResizer (stageElement, options) {
options = options || {};
this._element = stageElement;
this._stageWidth = options.stageWidth || stageElement.offsetWidth || 1;
this._stageHeight = options.stageWidth || stageElement.offsetWidth || 1;
this._snapToEdge = options.snapToEdge || true;
@yi
yi / nix_command.md
Created February 11, 2016 06:29
常用的unix指令集合

在长文本中显示指定的行号的行内容

Example 1: Display specific lines (based on line number) of a file using sed command

View only the specific lines mentioned by line numbers.

Syntax:

$ sed -n -e Xp -e Yp FILENAME

@yi
yi / fake-script.js
Created October 20, 2016 16:22 — forked from WebReflection/fake-script.js
hot to mock script requests
document.createElement = function (
createElement, // the native one
createResponse // the function "in charge"
) {
return function (nodeName) {
var result, src;
// if we are creating a script
if (/^script$/i.test(nodeName)) {
// result will be a place holder
result = createElement.call(
@yi
yi / open_app.html
Created February 22, 2017 08:46 — forked from noelrocha/open_app.html
Open app on Google Play or AppStore
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Open App</title>
<!--
URL Params:
customSchemeURL: Your custom scheme app