Skip to content

Instantly share code, notes, and snippets.

View techird's full-sized avatar

techirdliu techird

View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
</body>
</html>
@techird
techird / all.js
Last active December 26, 2015 21:09
var ns = 'http://www.w3.org/2000/svg',
svg = document.createElementNS(ns, 'svg'),
div = document.createElement('div');
document.body.appendChild(div);
div.appendChild(svg);
svg.setAttribute('width', 400);
svg.setAttribute('height', 300);
svg.style.background = '#eee';
<!DOCTYPE html>
<html>
<head></head>
<body>Hello, world!</body>
</html>
.triangle {
content: ' ';
display: block;
width: 0;
height: 0;
line-height: 0;
font-size: 0;
border-style: solid;
border-color: transparent;
}
@techird
techird / test.md
Created November 3, 2014 06:07
test image upload

d

@techird
techird / jscheck
Last active August 29, 2015 14:09
#!/bin/sh
# @Author: techird
# @Date: 2014/11/19 11:10
# @Last Modified by: techird
# @Last Modified time: 2014/11/19 11:10
#git diff --cached --name-only --diff-filter=ACMR
files=$(git diff --cached --name-only --diff-filter=ACMR | grep "\.js$")
if [ "$files" = "" ]; then
exit 0
mkdir -p ./.git/hooks/ && curl -s https://gist.githubusercontent.com/techird/0104a1dd01c2d19919c5/raw > ./.git/hooks/pre-commit && chmod +x ./.git/hooks/pre-commit && echo 'Install Success!'
bash -c "$(curl -s https://gist.githubusercontent.com/techird/f301476006209e039630/raw)"
@techird
techird / a.svg
Last active August 29, 2015 14:13
Use shape with clipPath
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@techird
techird / promise.js
Created January 27, 2015 04:55
svg loader
define(function(require, exports, module) {
/*!
** Thenable -- Embeddable Minimum Strictly-Compliant Promises/A+ 1.1.1 Thenable
** Copyright (c) 2013-2014 Ralf S. Engelschall <http://engelschall.com>
** Licensed under The MIT License <http://opensource.org/licenses/MIT>
** Source-Code distributed on <http://github.com/rse/thenable>
*/
/* promise states [Promises/A+ 2.1] */
var STATE_PENDING = 0; /* [Promises/A+ 2.1.1] */