Skip to content

Instantly share code, notes, and snippets.

View naoyeye's full-sized avatar
🦾

J.Y Han naoyeye

🦾
View GitHub Profile
@import "compass/utilities/sprites";
@import "compass";
@import "compass/css3";
@import "reset";
@import "basic";
@import "header";
@import "footer";
@import "card";
@import "badge";
@naoyeye
naoyeye / make_thumb.py
Last active August 29, 2015 14:02
python 生成 缩略图
import os
import Image
#生成node 75x75 缩略图
def make_node_thumb(path):
base, ext = os.path.splitext(path)
try:
im = Image.open(path)
except IOError:
print ' in IOError'
// 压缩后:
<div id="article-content"><div><br></div><div>在这里写文章<div contenteditable="false" class="comment-tpl-wrap tpl-wrap" id="comment-tpl-2" data-id="3369401"><div class="comment-tpl"><div class="box-action"><span class="edit"><i class="icon pencil"></i> 修改</span><span class="remove"><i class="icon remove"></i> 删除</span></div><form class="comment-id-input ui form" style="display: none;"><div class="ui input action"><input type="text" placeholder="请输入目标评论的ID"><button type="submit" class="ui button icon"><i class="icon add sign"></i></button></div></form><div class="card comment-box-wrap" style="display: block;"><div class="comment-box"><a class="author-avatar" href="http://baidu.com" target="_blank"> <img alt="jyTI" src="http://www.regexbuddy.com/img/icon.png"></a><div class="box-info"><span class="author-name"><a href="http://baidu.com" target="_blank">jyTI</a></span><p contenteditable="true" class="comment-content">这是一段内容</p></div></div></div></div></div></div></div>
// 原始html:
<div id="article-content
@naoyeye
naoyeye / youtubeShare.js
Created May 28, 2014 10:16
youtubeShare.js
function newShare() {
function ln(){
aw.call(this,\"Line\", \"ln\")
}
A(ln,ew);
ln.prototype.B=function(a,b){
return Qg(\"http://line.me/R/msg/text/\", {
text: bw(this,a)
@naoyeye
naoyeye / youtube_share.js
Last active August 29, 2015 14:01
add Line to youtube share
function ew(a,b){aw.call(this,a,b)}A(ew,aw);
ew.prototype.D = function(a){
window.open(a, "_blank", "menubar=no,toolbar=no,resizable=yes,status=no,fullscreen=yes")
};
// 只有这几行这是新加的
// Line =========
function ln(){
@naoyeye
naoyeye / index.jade
Created May 12, 2014 08:05
grunt jade html 5 modernizr simple template
doctype html
//- if lt IE 7
html.no-js.lt-ie9.lt-ie8.lt-ie7
//- if IE 7
html.no-js.lt-ie9.lt-ie8
//- if IE 8
html.no-js.lt-ie9
//- [if gt IE 8] <!
html.no-js(lang="en")
//- <![endif]
@naoyeye
naoyeye / gist:e1857e89d1201df49df2
Last active August 29, 2015 14:00
wechat share QR
<link rel="stylesheet" href="/components/fancybox/source/jquery.fancybox.css">
<script src="/components/fancybox/source/jquery.fancybox.js"></script>
<style>
#panel-weixin {
display: none;
text-align: center;
}
#panel-weixin .weixin-section {
@naoyeye
naoyeye / xiamiplayer.py
Last active August 29, 2015 13:56
auto convert xiami.com links to player
# auto convert xiami.com links to player
def xiami(value):
musics = re.findall('(http://www.xiami.com/song/[0-9]+)\s?', value)
if (len(musics) > 0):
for music in musics:
music_id = re.findall('http://www.xiami.com/song/([0-9]+)', music)
value = value.replace('http://www.xiami.com/song/' + music_id[0],
'<embed src="http://www.xiami.com/widget/15289_' + music_id[0] + '/singlePlayer.swf" type="application/x-shockwave-flash" width="257" height="33" wmode="transparent"></embed>')
return value
else:
@naoyeye
naoyeye / angular.filter.HTML2TXT.js
Created January 2, 2014 14:53
angular filter escape HTML special characters
/*
# Usage in html template:
"xxx | HTML2TXT"
<div ng-bind-html=" YourString | HTML2TXT "></div>
=======
@naoyeye
naoyeye / angular.filters.nl2br.js
Created January 2, 2014 14:36
angular nl2br filter
/*
# Usage in html template:
"xxx | nl2br"
<div ng-bind-html=" YourString | nl2br "></div>
or: