Skip to content

Instantly share code, notes, and snippets.

View yangjunjun's full-sized avatar
🐱
Focusing

杨军军 yangjunjun

🐱
Focusing
  • undefined
  • Xian, Shaanxi, China
View GitHub Profile
@yangjunjun
yangjunjun / NodeList-html.html
Created May 13, 2014 08:44
Dojo中Dom节点遍历与修改
<ul>
<li class="alkaline">Apples</li>
<li class="alkaline">Persimmons</li>
<li class="alkaline">Thompson Grapes (Seedless)</li>
<li class="alkaline">Muscat Grapes</li>
<li class="alkaline">All Sweet Grapes</li>
<li class="alkaline">Fresh Figs</li>
<li class="alkaline">Dates</li>
<li class="alkaline">Figs</li>
</ul>
@yangjunjun
yangjunjun / fs-demo.js
Last active August 29, 2015 14:01
nodejs 的 FileSystem相关代码
// 同步读写
fs.writeFileSync('b.txt', fs.readFileSync('a.txt'));
// 异步读写
// 版本一
fs.createReadStream('a.txt').pipe(fs.createWriteStream('b.txt'));
// 版本二
var rs = fs.createReadStream('a.txt');
@yangjunjun
yangjunjun / require.a.js
Last active February 12, 2024 00:07
SeaJS与RequireJS的区别
define('a', function(){
console.log('module a parse ...');
return {
a: function(){
console.log('module a execute ...');
}
}
})
@yangjunjun
yangjunjun / getDoubanPics
Created April 20, 2014 14:24
批量下载豆瓣相册图片
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# 批量下载豆瓣相册图片v0.1
# 步骤:
# 1. 获取图片的页面地址
# 2. 获取页面上图片的地址
# 3. 获取图片,写入文件
# 导入所需要的模块
@yangjunjun
yangjunjun / getDouBanImages.js
Created April 17, 2014 09:49
批量获得豆瓣相册的照片的原地址
/*
* 批量获得豆瓣相册的照片的原地址
*
* 用法:
* 1. 打开某相册的首页,如 http://www.douban.com/photos/album/122789497/
* 2. 打开控制台,把运行下面的代码
*
* 不足:
* 1. 只能下载相册第一页的图片
*/
;(function($, window, document){
$.yangLazyLoad = function(){
var img = $('img[data-src]');
img.each(function(){
this.src = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB/AAffA0nNPuCLAAAAAElFTkSuQmCC';
})
$(document).scroll(function(){
img.each(function(){
var _this = this;
var top = $(_this).offset().top;
.rainbow {
color: #00bfff;
-webkit-text-fill-color: transparent;
background-image: -webkit-gradient(linear,left top,right top,color-stop(0,#f22),color-stop(0.15,#f2f),color-stop(0.3,#22f),color-stop(0.45,#2ff),color-stop(0.6,#2f2),color-stop(0.75,#2f2),color-stop(0.9,#ff2),color-stop(1,#f22));
background-image: gradient(linear,left top,right top,color-stop(0,#f22),color-stop(0.15,#f2f),color-stop(0.3,#22f),color-stop(0.45,#2ff),color-stop(0.6,#2f2),color-stop(0.75,#2f2),color-stop(0.9,#ff2),color-stop(1,#f22));
background-image: -o-linear-gradient(transparent,transparent);
background-image: -ms-linear-gradient(transparent,transparent);
background-image: -moz-linear-gradient(transparent,transparent);
-webkit-background-clip: text;
background-clip: text;
@yangjunjun
yangjunjun / SassMeister-input.scss
Created March 24, 2014 01:54
Generated by SassMeister.com.
// ----
// Sass (v3.3.4)
// Compass (v1.0.0.alpha.18)
// ----
%message {
padding: .5em;
margin-bottom: .5em;
border-radius: .15em;
border: 1px solid;
@yangjunjun
yangjunjun / StylishPlus.com RWD Scheme.md
Last active August 29, 2015 13:57
网站响应式改版方案

1. 综述

主要使用Foundation响应式框架来进行改版,目前根据公司网站的情况,把重点放在一下三个尺寸的设备以进行响应式优化(可以根据公司的访问情况来做进一步的优化):

  • 手机 (0 - 640px)
  • 平板 (640 - 1000)
  • 桌面 (>1000)

2. 改版内容

主要分为 响应式布局响应式内容(图片)

@yangjunjun
yangjunjun / SassMeister-input.scss
Created March 4, 2014 14:32
Generated by SassMeister.com.
// ----
// libsass (v0.7.0)
// ----
$list:(10px, 20px, 30px, 40px);
$la:(1, 2, 3, 4);
$lb:(5, 6, 7);
$lc:join($la, $lb);
$len:length($list);
$lc:append($lc, 8);