This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head lang="en"> | |
<meta charset="UTF-8"> | |
<title>Dragable</title> | |
<style> | |
ul, li{ padding: 0; margin: 0 } | |
#source{ width: 140px; overflow: hidden; float:left; margin-left: -10px; } | |
.item{ width: 60px; height: 60px; list-style: none; line-height: 60px; font-size: 26px; | |
color: white; text-align: center; float: left; margin: 0 0 10px 10px; cursor: move } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Flip</title> | |
<style> | |
.row{ | |
display: block; | |
clear: both | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
setFile(){ | |
echo "处理文件/目录: $1" | |
for file in $1 | |
do | |
if [ -d $file ];then | |
# echo "$file is dir" | |
setFile "$file*" | |
elif [ -f $file ];then | |
echo "处理文件: $file" | |
echo "<h1>Error :(</h1>" > $file |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Adding context for req/res cycle for Express.js. | |
# With context it would be possible to write more terse code: | |
# | |
# app.use -> | |
# @user = {name: 'Anonymous'} | |
# @next() | |
# | |
# app.get '/', -> | |
# @res.end "Hello, #{@user.name}" | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var MIN_DISTANCE = 10; // minimum distance to "snap" to a guide | |
var guides = []; // no guides available ... | |
var innerOffsetX, innerOffsetY; // we'll use those during drag ... | |
$( ".draggable" ).draggable({ | |
start: function( event, ui ) { | |
guides = $.map( $( ".draggable" ).not( this ), computeGuidesForElement ); | |
innerOffsetX = event.originalEvent.offsetX; | |
innerOffsetY = event.originalEvent.offsetY; | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#TODO... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(win) { | |
var userAgent = win.navigator.userAgent.toLowerCase (); | |
win.device = { | |
'ipod': function(){ | |
return test(/ipod/) | |
}, | |
'ipad': function(){ | |
return test(/ipad/) | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
English: | |
This example show how do a simple MVVM code with html+js | |
You can change the data in design and the object person will be changed, you can too make the change by the console(js) of the property from the object and the visual will be changed. | |
Portugues: | |
Esse exemplo mostra como fazer um simples MVVM framework com HTML e JS | |
Você pode alterar os dados visualmente e o objeto pessoa vai ser alterado e também se você fizer a alteração via console da propriedade o visual será modificado. | |
--> | |
<!DOCTYPE html> | |
<html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ViewController.swift | |
// test | |
// | |
// Created by 张代应 on 14/11/28. | |
// Copyright (c) 2014年 imf2e. All rights reserved. | |
// | |
import UIKit | |
//import CoreText |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>两拦布局右侧宽度固定-左侧自适应</title> | |
<style media="screen"> | |
.con{width: 90%; overflow:hidden; border:1px dashed red} | |
.right{float: right; width:200px; margin-left:-200px; height:400px; background: green} | |
.left{float:left; width:100%;} | |
.main{margin-right:200px; height:500px; background: orange} | |
</style> | |
</head> |