Skip to content

Instantly share code, notes, and snippets.

View MrRaindrop's full-sized avatar

Parzival MrRaindrop

View GitHub Profile
@MrRaindrop
MrRaindrop / weex-vue-render-config-for-vue-loader.js
Last active September 25, 2017 06:38
webpack vue-loader config for weex-vue-render based on vue2.x.
/**
* //////////////////////////////
* webpack 1.x:
* //////////////////////////////
*/
module: {
loaders: [
{
test: /\.js$/,
loaders: ['babel-loader'],
@MrRaindrop
MrRaindrop / weex-vue2-demo-for-animation-transition-translateX.vue
Last active March 11, 2017 16:12
weex-vue2: a demo for animation.transition of translateX.
<template>
<scroller>
<text>{{constr}}</text>
</scroller>
</template>
<script>
module.exports = {
data () {
return { constr: 'list' }
@MrRaindrop
MrRaindrop / rollup.config.js
Created December 19, 2016 12:39
js: rollup config.
import { rollup } from 'rollup'
import postcss from 'rollup-plugin-postcss'
import json from 'rollup-plugin-json'
import eslint from 'rollup-plugin-eslint'
import nodeResolve from 'rollup-plugin-node-resolve'
import commonjs from 'rollup-plugin-commonjs'
import buble from 'rollup-plugin-buble'
const pkg = require('../package.json')
const version = pkg.version
@MrRaindrop
MrRaindrop / scroller-demo.we
Created September 19, 2016 03:35
scroller-demo with loading more data
<template>
<scroller class="list" append="node">
<refresh class="refresh-view" display="{{refresh_display}}" onrefresh="onrefresh">
<loading-indicator style="height:60;width:60" ></loading-indicator>
<text class="refresh-arrow" style="text-align: center; color:rgb(238, 162, 54)" if="{{(refresh_display==='hide')}}">Pull To Refresh</text>
</refresh>
<div class="section" repeat="{{sections}}">
<div class="header">
#!/bin/bash
git filter-branch --env-filter '
an="$GIT_AUTHOR_NAME"
am="$GIT_AUTHOR_EMAIL"
cn="$GIT_COMMITTER_NAME"
cm="$GIT_COMMITTER_EMAIL"
if [ "$GIT_COMMITTER_EMAIL" = "old email" ]
@MrRaindrop
MrRaindrop / Remove node_modules from git repo
Last active August 29, 2015 14:25 — forked from paulallies/gist:0052fab554b14bbfa3ef
Remove node_modules from git repo
#add 'node_modules' to .gitignore file
git rm -r --cached node_modules
git commit -m 'Remove the now ignored directory node_modules'
git push origin master
@MrRaindrop
MrRaindrop / js: simple implementation of browserifyjs.js
Created July 14, 2015 07:06
js: simple implementation of browserifyjs
// author ranyifeng
// link: http://www.ruanyifeng.com/blog/2015/05/commonjs-in-browser.html
//
// Usage
//
// require.register("browser/debug.js", function(module, exports, require){
// // Module code goes here
// });
//
// var debug = require("browser/debug.js");
@MrRaindrop
MrRaindrop / js: es6-template-string-for-if.js
Created July 3, 2015 08:02
js: es6-template-string-for-if
#!/usr/bin/env iojs
function $for(data, tpl) {
return data.map(tpl).join('');
}
function $if(condition, datathen, tplthen) {
return {
$else: function(dataelse, tplelse) {
if (!!condition) {
@MrRaindrop
MrRaindrop / js: simple-template-implementation.js
Last active August 29, 2015 14:24
js: simple-template-implementation
// Simple JavaScript Templating
// John Resig - http://ejohn.org/ - MIT Licensed
(function(){
var cache = {};
this.tmpl = function tmpl(str, data){
// Figure out if we're getting a template, or if we need to
// load the template - and be sure to cache the result.
var fn = !/\W/.test(str) ?
cache[str] = cache[str] ||
@MrRaindrop
MrRaindrop / js: react+线性分割算法实现的类似flickr的图片布局
Last active August 29, 2015 14:16 — forked from kejun/gist:72112e5848f5e3921b0d
js: react+线性分割算法实现的类似flickr的图片布局
var React = require('react');
var EventListener = require('react/lib/EventListener');
var partition = require('linear-partitioning');
var TileLayout = React.createClass({
getDefaultProps: function() {
return {
gutter: 0,
photos: []
}