今天同事聊到三角形箭头,于是提到这个在线工具。
这是以前糯米发的一个网址,在线定制各种 CSS3 箭头,生成 CSS 代码,前端同学可以收藏一下(翻墙访问会快点)。
今天同事聊到三角形箭头,于是提到这个在线工具。
这是以前糯米发的一个网址,在线定制各种 CSS3 箭头,生成 CSS 代码,前端同学可以收藏一下(翻墙访问会快点)。
关于文件对比,以前用 notepad++ 时习惯了里面的 compare 插件。
sublime 也有类似插件 sublimerge。
这个插件是收费插件,但是免费版好像也没太大限制:
Without a license, Sublimerge runs in evaluation mode. There are no time and functionality limitations, but for continuous usage it requires purchasing a license. Unregistered copy will display a cyclic reminder message.
这个解释有点委婉,不知道什么场合叫 continuous usage
2014-4-19 更新:
今天知道了 continuous usage 的意思,即连续使用 sublimerge 的功能时,会弹出一个弹窗,取消就可以了(情形和 sublime 的免费版类似):
Sublimerge
Thanks for trying out Sublimerge!
This is an unregistered evaluation version and a license must be purchased for continued use.
Be fair and support development : )
Would you like to purchase a license now?
2016-12-1 更新:
sublimerge 收费了,不想买的话可以参考这篇日志《sublime 文件比对》。
又一个里程碑到来,今天开始收费,暂时只限 40 个 VIP 名额,结果很快就很多商户交费了。
我们这个产品比较奇葩,很多产品是想着怎么忽悠用户交费,我们是用户追着要交费给我们,买个安心。去年的时候就有很多用户在问收费的事,总觉得免费的用着不放心,不过那时候我们还小,还没有收费计划。
关闭 sublime 后,下次打开时不会记住侧栏的 folders,通过 project 可以方便的管理。
添加:
Project > Add Folder to Project
也可以直接把目录拖到 sublime 中
保存、编辑:
Project > Save Project As
点击保存,将在选定的目录生成两个文件:
project_name.sumlime-project:包含工程定义,该文件会被记录到版本控制里。
project_name.sublim-workspace:包含了用户的工程数据,例如打开的文件和修改等,该文件不会被记录到版本控制里。
在 *.sublime-project 文件中( Project > Edit Project),可以定义工程配置。例如可以定义多个目录路径,或者哪些目录或文件需要排除在外。通过定义 “name”,可以将一些长路径或者名字很长的目录以更简洁的名称显示在 sidebar 中。
例如:
{
"folders":
[
{
"path": "wwwroot",
"folder_exclude_patterns": ["images"]
},
{
"path": "c:\wwwroot\project1\assets",
"name": "Project 1",
"file_exclude_patterns": ["*.php"]
}
],
"settings":
{
"tab_size": 8
}
}
1、直接用iframe
2、weather.com.cn 智慧天气应用编程接口开放平台 – 文档、图标下载
http://weather.com.cn/wzfw/smart/weatherapi.shtml
3、中国气象局提供了三个天气查询的API接口
http://www.weather.com.cn/data/sk/101190101.html
http://www.weather.com.cn/data/cityinfo/101190101.html
http://m.weather.com.cn/data/101190101.html
以json格式返回数据,第一和第二个接口返回当天实时的天气数据,第三个返回未来五天天气情况。
其中地址里的数字表示城市的代码:101190101 代表南京
第三个接口的返回数据示例及说明如下:
{
weatherinfo: {
city: "南京",
city_en: "nanjing",
date_y: "2013年9月8日",
date: "",
week: "星期日",
fchh: "18",
cityid: "101190101", //城市代码
temp1: "22℃~30℃", //第一天(当天)最高喝最低温度(摄氏温度)
temp2: "23℃~29℃", //第二天最高喝最低温度(摄氏温度)
temp3: "22℃~28℃", //第三天最高喝最低温度(摄氏温度)
temp4: "23℃~30℃", //第四天最高喝最低温度(摄氏温度)
temp5: "24℃~28℃", //第五天最高喝最低温度(摄氏温度)
temp6: "23℃~28℃", //第六天最高喝最低温度(摄氏温度)
tempF1: "71.6℉~86℉", //第一天(当天)最高喝最低温度(华氏温度)
tempF2: "73.4℉~84.2℉", //第二天最高喝最低温度(华氏温度)
tempF3: "71.6℉~82.4℉", //第三天最高喝最低温度(华氏温度)
tempF4: "73.4℉~86℉", //第四天最高喝最低温度(华氏温度)
tempF5: "75.2℉~82.4℉", //第五天最高喝最低温度(华氏温度)
tempF6: "73.4℉~82.4℉", //第六天最高喝最低温度(华氏温度)
weather1: "多云转阴", //第一天(当天)天气
weather2: "小雨", //第二天天气
weather3: "小雨",
weather4: "阴",
weather5: "小雨转中雨",
weather6: "中雨转阴",
img1: "1", //第一天的天气图片代码1
img2: "2", //第一天的天气图片代码2
img3: "7", //第二天的天气图片代码1
img4: "99", //第二天的天气图片代码2
img5: "7",
img6: "99",
img7: "2",
img8: "99",
img9: "7",
img10: "8",
img11: "8",
img12: "2",
img_single: "2"
img_title1: "多云", //第一天的天气图片1的标题
img_title2: "阴", //第一天的天气图片2的标题
img_title3: "小雨", //第二天的天气图片1的标题
img_title4: "小雨", //第二天的天气图片2的标题
img_title5: "小雨",
img_title6: "小雨",
img_title7: "阴",
img_title8: "阴",
img_title9: "小雨",
img_title10: "中雨",
img_title11: "中雨",
img_title12: "阴",
img_title_single: "阴",
wind1: "东风3-4级", //第一天风向范围
wind2: "东风3-4级", //第二天风向范围
wind3: "北风转东北风3-4级",
wind4: "东北风3-4级",
wind5: "东北风转西风3-4级",
wind6: "西南风转西风3-4级",
fx1: "东风",
fx2: "东风",
fl1: "3-4级", //第一天风级范围
fl2: "3-4级",
fl3: "3-4级",
fl4: "3-4级",
fl5: "3-4级",
fl6: "3-4级",
index: "热", //二十四小时穿衣指数
index_d: "天气热,建议着短裙", //建议
index48: "热", //四十八小时穿衣指数
index48_d: "天气热,建议着短裙", //建议
index_uv: "弱", //二十四小时紫外线
index48_uv: "弱", //四十八小时紫外线
index_xc: "不宜", //洗车
index_tr: "适宜", //旅游
index_co: "较舒适", //舒适度
st1: "30",
st2: "20",
st3: "27",
st4: "19",
st5: "26",
st6: "18",
index_cl: "较适宜", //晨练
index_ls: "不太适宜", //晾晒
index_ag: "极易发" //过敏
}
}
参考:http://www.cnblogs.com/laosan/p/how-to-write-a-weather-api.html
星期二 晴 27~38℃
js 判断浏览器(含360)
判断 360 浏览器,详见:http://xliar.com/thread-138-1-1.html
下面的 360 判断是从上面的方法中抽离的,只允许 chrome 以及 IOS 上的 safari 访问:
function checkBrowser() {
var ua = navigator.userAgent,
isChrome = (ua.indexOf("Chrome") != -1) ? true : false,
isIOS = /\((iPhone|iPad|iPod)/i.test(ua) ? true : false,
isSafari = (ua.indexOf("Safari") != -1) ? true : false,
help = function () {
alert(‘非chrome浏览器’);
};
if (!isChrome) {
if (isIOS && isSafari) {
// 在IOS上使用safari
} else {
help();
}
} else {
// 360
var subtitleEnabled = function () {
return "track" in document.createElement("track");
},
scopedEnabled = function () {
return "scoped" in document.createElement("style");
};
if (subtitleEnabled() && scopedEnabled()) {
help();
}
}
}
chrome扩展开发笔记(10) notification升级
chrome 更新到 v28,发现以前使用 createHTMLNotification() 创建桌面通知的方法:
webkitNotifications.createHTMLNotification(‘notification.html’);
会报错:
Uncaught TypeError: Object #<NotificationCenter> has no method ‘createHTMLNotification’
新的 notification 只支持“文本”和“图片”,且不再支持加载 html 页面。
参考:
(英文)https://developer.chrome.com/apps/desktop_notifications.html
(中文)https://crxdoc-zh.appspot.com/apps/desktop_notifications.html
新的 notification 方法参考:
(英文)https://developer.chrome.com/apps/notifications.html
(中文)https://crxdoc-zh.appspot.com/apps/notifications.html
(以上参考资料可能需要翻墙访问)
屌丝团记忆(55) 吃饭,永远的痛
一到吃饭时间就纠结,磨磨蹭蹭,磨磨叽叽,去哪吃呢?
其实去哪吃并不重要,重要的是,吃饭时间到了,就得先站起来走出去再说。
星期四 少云 26~37℃
html5 本地存储写入读取json
var data = {
intro: ‘test’,
arr: []
};// 写入(把json转成字符串)
localStorage.setItem(‘my_storage’, JSON.stringify(data));// 读取(把json字符串解析成json)
var json = JSON.parse(localStorage.getItem(‘my_storage’));
alert(json.intro);
办公室健身(36)
俯卧撑,下午 60 个。
星期一 晴 26~36℃
动态布局库 isotope
暂时用不上,记录一下。
Isotope 是一个jQuery的插件,用来实现精美的动态元素布局。
Isotope可以实现仅仅依靠CSS3无法实现的动态布局方式,可以动态添加,删除,排序,筛选元素。Isotope的动画引擎可以充分使用现代浏览器CSS动画中GPU硬件加速性能。
屌丝团记忆(45) 新同学
上周新入一位后端同学,今天新入一位运营同学,一共 13 人了。
接下去主要招的是后端和运营,前端可能也还要再招一个。
星期一 阴,傍晚暴雨 24~31℃
Koala – 开源前端预处理器语言编译工具(支持Less、Sass、CoffeeScript编译)
http://koala-app.com/index-zh.html
Backbone.js入门学习笔记(推荐教程)
找了一些中文教程,这个还不错,比我看到的其他中文教程好。
http://www.the5fire.com/backbone-tutorials-catalogue.html
2013-9-10 更新:
糯米同学推荐的:Backbone源码分析-Backbone架构+流程图
星期六 蒙蒙雨转阴 23~31℃
屌丝团记忆(42) 前端目录结构讨论
今天讨论前端目录结构,定下的结构:
/static
-/core(内部js, css)
–/base
-/vendor(外来js)
-/apps(所有的模块都放在这个目录下)
–/app_1
—/js
—/css
—…
–/app_2
–…
-/image(不把 image 放在的 app 各自的目录下,是考虑到目录移动的灵活性,如 cdn 等)
-/components(2013.06.28讨论新增)
主要用到 jQuery/RequireJS/Backbone/Underscore.
星期四 阴 22~31℃
html5 audio 语音播放在手机端使用注意
在手机端需要先播放,否则监听不到 canplay.
ios、android的chrome
var player = $(‘audio’).get(0);
//var ios = (/(ipod|iphone|ipad)/i).test(navigator.userAgent);
var mobile = !!navigator.userAgent.match(/AppleWebKit.*Mobile./);
if (mobile) {
player.play();
}
player.addEventListener(‘canplay’, function() {
// …
});
扩展阅读:
http://kolber.github.io/audiojs/
http://leiyongping88.iteye.com/blog/1831145
在家健身(76)
小区里慢跑 6 圈,25 分钟左右。