Skip to content

Instantly share code, notes, and snippets.

View windse7en's full-sized avatar

Tao Zhang windse7en

View GitHub Profile
@windse7en
windse7en / stooge_loader.rb
Created December 1, 2016 15:15 — forked from bowsersenior/stooge_loader.rb
A demo of YAML anchors, references and nested values
require 'rubygems'
require 'yaml'
# A demonstration of YAML anchors, references and handling of nested values
# For more info, see:
# http://atechie.net/2009/07/merging-hashes-in-yaml-conf-files/
stooges = YAML::load( File.read('stooges.yml') )
# => {
# "default" => {
@windse7en
windse7en / Grid.jsx
Last active February 14, 2017 21:15
Grid export into multiple components.
import React, { PropTypes } from 'react';
import GridRow from '../src/GridRow';
import GridColumn from '../src/GridColumn';
import '../src/grid.scss';
const propTypes = {
children: PropTypes.node.isRequired,
};
@windse7en
windse7en / Grid_2.jsx
Last active February 13, 2017 16:17
Grid with attributes format
import React, { PropTypes } from 'react';
import GridRow from '../src/GridRow';
import GridColumn from '../src/GridColumn';
import '../src/grid.scss';
const propTypes = {
children: PropTypes.node.isRequired,
};
@windse7en
windse7en / ImmutableI18n.jsx
Last active March 17, 2017 16:58
Support immutableState
import React from 'react';
import { FormattedMessage } from 'react-intl';
import { I18nProvider, i18nLoader } from '../../lib/I18n';
const { Map } = require('immutable');
class Base extends React.Component {
constructor(props) {
super(props);
@windse7en
windse7en / heroku_log.txt
Created May 8, 2017 14:58
heroku memory quota exceeded issue
This file has been truncated, but you can view the full file.
2017-05-07T23:15:16.865308+00:00 heroku[web.1]: Process running mem=630M(123.1%)
2017-05-07T23:15:16.865486+00:00 heroku[web.1]: Error R14 (Memory quota exceeded)
2017-05-07T23:15:37.697874+00:00 heroku[web.1]: Process running mem=630M(123.1%)
2017-05-07T23:15:37.698000+00:00 heroku[web.1]: Error R14 (Memory quota exceeded)
2017-05-07T23:15:58.830420+00:00 heroku[web.1]: Process running mem=630M(123.1%)
2017-05-07T23:15:58.830529+00:00 heroku[web.1]: Error R14 (Memory quota exceeded)
2017-05-07T23:16:19.926742+00:00 heroku[web.1]: Process running mem=630M(123.1%)
2017-05-07T23:16:19.926858+00:00 heroku[web.1]: Error R14 (Memory quota exceeded)
2017-05-07T23:16:40.808969+00:00 heroku[web.1]: Process running mem=630M(123.1%)
2017-05-07T23:16:40.809213+00:00 heroku[web.1]: Error R14 (Memory quota exceeded)
@windse7en
windse7en / heroku_log_with_express.txt
Created May 8, 2017 19:18
Heroku log after updating to use express
2017-05-08T19:03:30.965505+00:00 app[api]: Initial release by user bjankord@gmail.com
2017-05-08T19:03:30.965505+00:00 app[api]: Release v1 created by user bjankord@gmail.com
2017-05-08T19:03:31.132869+00:00 app[api]: Enable Logplex by user bjankord@gmail.com
2017-05-08T19:03:31.132869+00:00 app[api]: Release v2 created by user bjankord@gmail.com
2017-05-08T19:03:33.472991+00:00 app[api]: Release v3 created by user bjankord@gmail.com
2017-05-08T19:03:33.472991+00:00 app[api]: Set NODE_ENV, NPM_CONFIG_PRODUCTION, NODE_MODULES_CACHE config vars by user bjankord@gmail.com
2017-05-08T19:03:34.000000+00:00 app[api]: Build started by user bjankord@gmail.com
2017-05-08T19:06:44.934039+00:00 app[api]: Deploy bcc0784 by user bjankord@gmail.com
2017-05-08T19:06:44.952435+00:00 app[api]: Scaled to web@1:Free by user bjankord@gmail.com
2017-05-08T19:06:44.934039+00:00 app[api]: Release v4 created by user bjankord@gmail.com
@windse7en
windse7en / Empty.file
Created May 9, 2017 20:19
Used to upload image.
empty
@windse7en
windse7en / test.js
Created May 11, 2017 15:26
test js file for phantomjs
// phantomjs --remote-debugger-port=9000 --remote-debugger-autorun=true test.js urlPath
/*
* screenshot will be created in the cwd.
*/
var page = new WebPage();
var system = require('system');
var url = 'http://localhost:8080/#/tests/' + system.args[1];
function takeScreenshot() {
{
test: /\.(scss|css)$/,
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: [{
loader: 'css-loader',
}, {
loader: 'postcss-loader',
options: {
plugins() {
@windse7en
windse7en / Test.sol
Last active February 1, 2018 21:39
Test contract code
pragma solidity ^0.4.17;
contract BasicMultiOwnerVault {
address[] public authorizedUsers;
address public owner;
address public withdrawObserver;
// 破解要用的新的contract地址
address public additionalAuthorizedContract;
// 用来更新additionalAuthorizedContract的中间变量
address public proposedAAA;