Skip to content

Instantly share code, notes, and snippets.

View naoyeye's full-sized avatar
🦾

J.Y Han naoyeye

🦾
View GitHub Profile
@naoyeye
naoyeye / Preferences.sublime-settings.py
Last active December 13, 2015 18:29
/Users/xxx/Library/Application Support/Sublime Text 3/Packages/User/Preferences.sublime-settings
{
"color_scheme": "Packages/Dracula Color Scheme/Dracula.tmTheme",
"draw_indent_guides": true,
"draw_white_space": "all",
"fade_fold_buttons": false,
"font_face": "Source Code Pro",
"font_size": 12.0,
"highlight_modified_tabs": true,
"ignored_packages":
[
@naoyeye
naoyeye / @chenyang.html
Created February 23, 2013 11:06
给陈扬写的表单验证
<!--form中的action需要增加你表单的提交地址,这样验证插件才能知道你的ajax往哪儿发: action="/record_email"-->
<form id="recordEmail" class="form-inline" method="post" enctype="multipart/form-data" accept-charset="utf-8" action="/record_email">
<!--.......-->
</form>
<script>
$('#recordEmail').Validform({
ajaxPost : true, //这里开启ajax提交
tiptype : function(msg,o,cssctl){
var objtip=o.obj.parents('#recordEmail').find(".Validform_checktip");
@naoyeye
naoyeye / doubanGreasemonkey.js
Created August 10, 2013 15:21
a Greasemonkey Script for douban, "赞" => "待阅","已赞" => "朕知道了"
// ==UserScript==
// @name IKnowIKnow
// @namespace IKnowIKnow
// @include http://*.douban.com/*
// @version 1
// @grant GM_setValue
// @grant GM_getValue
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js
// ==/UserScript==
controllers.controller('TabBarController',function TabBarController ($scope,$log,$http) {
var tabBarItem =$('#tabBar > .item');
var chatPanelOpen = false;
tabBarItem.click(function(){
var tabClass = $(this).data('tab');
if(!chatPanelOpen){
$('#wrapper').addClass(tabClass);
@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:
@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 / 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 / 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 / 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 / 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(){