Skip to content

Instantly share code, notes, and snippets.

View cssoul's full-sized avatar
🎯
Focusing

達也 cssoul

🎯
Focusing
  • -
View GitHub Profile
@cssoul
cssoul / react-loading.js
Created July 22, 2015 02:48
React Native Loading Animation
/**
* LoadingView
*/
'use strict';
var React = require('react-native');
var {
TouchableWithoutFeedback,
Animated,
@cssoul
cssoul / maimaimai
Created June 18, 2015 10:14
maimaimai
/**
* Sample React Native App
* https://github.com/facebook/react-native
*/
'use strict';
var React = require('react-native');
var ScrollableMixin = require('react-native-scrollable-mixin');
var TimerMixin = require('react-timer-mixin');
var TaoshijieView =require('./TaoshijieView');
@cssoul
cssoul / git-tips
Last active August 29, 2015 14:06
git tips.md
tip 1
git 保存的信息是每次变动 文件名称 内容 读写属性的改变都视为变动 比如:
vim test1.txt 添加1行 line1
git add
vim test1.txt 再添加1行 line 2
git commit -m "add file test1"
此时本地仓库保存到 test1.txt 的内容 是 line 1 只有1行 因为第二次修改的变动 没有 git add
tip 2
@cssoul
cssoul / gist:26516614e724af40c195
Created July 15, 2014 06:54
Mogujie Mobile Demo Template
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Mogujie Mobile Demo Template</title>
<!--
width=device-width:让文档的宽度与设备的宽度保持一致,且文档最大的宽度比例是1.0
initial-scale=1:初始的缩放比例
maximum-scale=1:允许用户缩放到的最大比例(对应还有个minimum-scale)
user-scalable=no:不允许用户手动缩放

如何创建公钥

  1. 首先启动一个Git Bash窗口(非Windows用户直接打开终端)

  2. 执行:

    cd ~/.ssh

    如果返回“… No such file or directory”,说明没有生成过SSH Key,直接进入第4步。否则进入第3步备份!

@cssoul
cssoul / gist:5612261
Created May 20, 2013 13:36
利用径向渐变实现 不规则渐变阴影
.top-shadow {
width: 200px;
height: 200px;
}
.top-shadow:after {
content: "";
width: 100%;
height: 8px;
display: block;
@cssoul
cssoul / gist:5487485
Last active December 16, 2015 19:49
JavaScript数组常用操作
/*建立数组*/
var Obj = new Array();
var Obj = new Array(size);
var Obj = new Array(element0, element1, ..., elementn);
/*遍历数组*/
for (var i in Obj)
{
console.log(Obj[i]+",");
@cssoul
cssoul / gist:5483564
Last active December 16, 2015 19:11
Flexbox实现元素水平、垂直局中
<!--HTML-->
<div class="flex-container">
<div class="flex-item">I'm centered!</div>
</div>
<!--CSS-->
<style>
.flex-container {
display: -webkit-flex;
display: flex;
@cssoul
cssoul / gist:5483396
Last active December 16, 2015 19:10
Flexbox相关知识
/*
* Flexbox 设置为伸缩容器(包括伸缩容器和伸缩项目)
* (flex /inline-flex )
*/
display: -webkit-flex;
display: flex;
/*
@cssoul
cssoul / gist:5479940
Created April 29, 2013 05:58
去除字符串的前后空格
String.prototype.Trim = function()
{
return this.replace(/(^\s*)|(\s*$)/g, "");
}
var str = ' abcdefg ';
console.log(str.trim());