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
import React, { Component, PropTypes} from 'react'; | |
import { View } from 'react-native'; | |
import { | |
Container, | |
Title, | |
Message, | |
Button | |
} from '../components'; | |
import { connect } from 'react-redux'; | |
import { actions as mainActions} from '../store/models/main'; |
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
// helper for debugging why your (pure) component is re-rendering | |
const wrapper = (Cmp) => (props) => { | |
if (wrapper.prevProps) { | |
console.log('re-rendering', Cmp.name); | |
Object.keys(props) | |
.filter(k => wrapper.prevProps[k] !== props[k]) | |
.forEach(k => console.log(k, wrapper.prevProps[k], props[k])); | |
} | |
wrapper.prevProps = props; | |
return <Cmp {...props} /> |
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
componentWillUnmount() { | |
registerScrollViewForm.unregister(this.scrollviewForm); | |
} | |
_setFormScrollView(scrollView) { | |
this.scrollview = scrollviewForm; | |
registerScrollViewForm.register(scrollView); | |
} | |
render() { |
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
import React, { Component, PropTypes } from 'react'; | |
import { | |
ActivityIndicator, | |
StyleSheet, | |
View | |
} from 'react-native'; | |
export default class HudComponent extends Component { | |
static propTypes = { |
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
"use strict"; | |
import React from "react-native"; | |
let { | |
StyleSheet, | |
View, | |
ScrollView, | |
PropTypes, | |
Component, | |
Text |
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 express = require('express'); | |
var app = express(); | |
app.get('/', function (req, res, next) { | |
next({ status: 403, message: 'this is forbidden'}); | |
}); | |
app.use(function (err, req, res, next) { | |
res.send(err.status || 500, err.message || "something broke"); | |
}); |
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
### | |
Include database config. | |
@var [Object] db | |
@api private | |
### | |
### | |
Set users collection |
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 util = require('util'), | |
EventEmitter = require('events').EventEmitter; | |
var MyClass = function () { | |
if (!(this instanceof MyClass)) return new MyClass(); | |
EventEmitter.call(this); | |
}; |
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
PS D:\apache\bin> .\ab.exe -n 100 http://one.org:3000/ | |
This is ApacheBench, Version 2.3 <$Revision: 1373084 $> | |
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ | |
Licensed to The Apache Software Foundation, http://www.apache.org/ | |
Benchmarking one.org (be patient).....done | |
Server Software: | |
Server Hostname: one.org |
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 https = require('https'); | |
var fs = require('fs'); | |
var crypto = require("crypto"); | |
var options = { | |
SNICallback: function (hostname) { | |
console.log('hostname: ' + hostname); | |
return crypto.createCredentials({ | |
key: fs.readFileSync('default.key'), | |
cert: fs.readFileSync('default.crt') |
NewerOlder