Skip to content

Instantly share code, notes, and snippets.

@janily
janily / dabblet.css
Created August 9, 2013 09:32 — forked from ralgh/dabblet.css
CSS image crop. Forces image to 4:3 aspect ratio cropping at the middle.
/**
* CSS image crop. Forces image to 4:3 aspect ratio cropping at the middle.
* http://dabblet.com/gist/4711695
*/
.img-crop,
.img-crop img{
width: 100%; /* gotta be responsive these days */
}
.img-crop{
background-color: #ededed; /* some background color for short images */

智勇大闯关第三季

8月20日,阿里校园招聘前端岗位的在线笔试将统一开始。在这之前,我们先玩一下热身赛吧! http://t.cn/zQRFjtd 截至8月18日11:00之前成功通关并且表现优异的同学,将有机会收到我们的惊喜邮件!

以上是阿里巴巴集团校园招聘的某一条微博的内容。

虽然我早已不是学生,本着好奇心也要玩一玩此游戏!经过几个小时的奋斗,我看到了美女,但不知道那是不是 True Ending。也许很多人把游戏通关之后就不玩不去探索了,可我不一样!我玩游戏向来都是要尽量把所有隐藏要素都挖掘出来才算结束。

正是因为知道结果,才有可能去优化过程,一个工程师的职责难道不正是这个么?“如何自动化、智能地去过每一关”的想法让我的血液稍微沸腾了起来。又经过几个小时的编码及测试,自我感觉已经把“隐藏要素”挖得差不多了。现将各个关卡的过关要点及自动获取过关条件的 JavaScript 脚本放出来。

$sprites: sprite-map("sprites/*.png");
$sprites-retina: sprite-map("sprites-retina/*.png");
@mixin sprite-background($name) {
background-image: sprite-url($sprites);
background-position: sprite-position($sprites, $name);
background-repeat: no-repeat;
display: block;
height: image-height(sprite-file($sprites, $name));
width: image-width(sprite-file($sprites, $name));
@janily
janily / single shadow
Created September 14, 2013 07:42
css3单边阴影
.gradient-shadow{
position: relative;
}
.gradient-shadow:before{
content: ' ';
background: -webkit-linear-gradient(top, #BBB,#EEE ,white 20%);
background: -moz-linear-gradient(top, #BBB,#EEE ,white 20%);
background: -o-linear-gradient(top, #BBB,#EEE ,white 20%);
background: linear-gradient(top, #BBB,#EEE ,white 20%);
position: absolute;
@janily
janily / randomColor
Created September 18, 2013 11:19
js随机颜色
function getRandomColor(){
return "#"+("00000"+((Math.random()*16777215+0.5)>>0).toString(16)).slice(-6);
}
"#"+(Math.random()*0.16777215).toString(16).substring(3,9);
@janily
janily / private-style
Created September 23, 2013 02:07
常用的浏览器私有属性
//一、控制元素的可选值
selector {
-moz-user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
}
//可选的值:
//auto——默认值,用户可以选中元素中的内容
@janily
janily / form align
Created September 25, 2013 02:21
form radio & checkbox解决方案
input,checkbox {
margin: 0 5px 0 0;
padding: 0;
width: 13px;
height: 13px;
font: 13px Helvetica, Arial, sans-serif;
}
#demo1fix .form-radio{ //字体12px
vertical-align:-2px;
*vertical-align:middle;/*ie7 ie6*/
We couldn’t find that file to show.
@janily
janily / font
Created September 28, 2013 08:51
网站字体设置
Font-family: Helvetica, Tahoma, Arial, STXihei, “华文细黑”, “Microsoft YaHei”, “微软雅黑”, SimSun, “宋体”, Heiti, “黑体”, sans-serif
来源 http://www.uisdc.com/web-font
<div>
<a href="{{protocol}}//{{host}}{{pathname}}">{{protocol}}//{{host}}{{pathname}}</a>
</div>
<script>
function Template(node) {
var prototype = document.createDocumentFragment();
prototype.appendChild(node);