This file contains 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>Demo</title> | |
</head> | |
<body> | |
<h1>PHP Mongo Test</h1> | |
<?php | |
try { | |
$connect = $_ENV["MONGOLAB_URI"]; | |
$m = new Mongo($connect); |
This file contains 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 } from 'react' | |
import { SubWidgetLink } from './routes' | |
export default class MyComponentWithALink extends Component { | |
render() { | |
const { widget } = this.props | |
return ( | |
<div> | |
... |
This file contains 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, { PropTypes } from 'react' | |
const Describe = ({ title, children }) => ( | |
<div> | |
<h1>{title}</h1> | |
<ul>{children}</ul> | |
</div> | |
) | |
Describe.propTypes = { |
This file contains 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 ReactDOMServer = require('react-dom/server'); | |
var cheerio = require('cheerio'); | |
module.exports = function( reactClass ) { | |
var staticMarkup = ReactDOMServer.renderToStaticMarkup(reactClass); | |
var $ = cheerio.load(staticMarkup); | |
return $.root().children().first(); | |
}; |
This file contains 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
// In v2/3 you did this: | |
import ReactDOM from 'react-dom' | |
import { Router, browserHistory, Route } from 'react-router' | |
ReactDOM.render( | |
<Router> | |
<Route path="/about" component={About}/> | |
<Route path="/:username" component={User}/> | |
</Router> | |
) |
This file contains 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 Modal from 'react-modal'; | |
import { addQuery, removeQuery } from './utils-router.js'; | |
const OPEN_MODAL_QUERY = 'openModal'; | |
function SomeComponent({ location }) { | |
return <div> | |
<button onClick={ () => addQuery({ OPEN_MODAL_QUERY : 1 })}>Open modal</button> | |
<Modal | |
isOpen={ location.query[OPEN_MODAL_QUERY] } |
This file contains 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
machine: | |
php: | |
version: 5.6.5 | |
dependencies: | |
cache_directories: | |
- vendor | |
- node_modules | |
pre: | |
- sudo pip install awscli |
This file contains 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 './login.styl'; | |
import Component from '../components/component.react'; | |
import React from 'react'; | |
import exposeRouter from '../components/exposerouter.react'; | |
import {focusInvalidField} from '../lib/validation'; | |
@exposeRouter | |
export default class Login extends Component { | |
static propTypes = { |
This file contains 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 generate_guid() { | |
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { | |
var r = Math.random()*16|0, v = c == 'x' ? r : (r&0x3|0x8); | |
return v.toString(16); | |
}); | |
} | |
function get_guid() { | |
if (window.localStorage.guid != null) { |
This file contains 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
#!/usr/bin/env bash | |
toggle-camera() { | |
if kextstat | grep AppleCameraInterface &>/dev/null; then | |
for ((i=0; i<3; i++)); do | |
if sudo kextunload /System/Library/Extensions/AppleCameraInterface.kext &>/dev/null; then | |
echo "toggle-camera: AppleCameraInterface unloaded" | |
return 0 | |
fi | |
done |
OlderNewer