Skip to content

Instantly share code, notes, and snippets.

View m4tthumphrey's full-sized avatar
🏂
Working...

Matt Humphrey m4tthumphrey

🏂
Working...
View GitHub Profile
<?php
require dirname(__DIR__) . '/vendor/autoload.php';
$chat = new \MyApp\Chat();
$app = new \Ratchet\App();
$app->route('/test', $chat);
$app->run();
@m4tthumphrey
m4tthumphrey / Reader.php
Created April 16, 2014 16:18
Simple class to iterate a CSV file quickly, allowing the user to manipulate the value of each field
<?php
class Reader
{
protected $fields = [];
protected $filters = [];
public function read($file)
{
try {
data = $('#form').serialize();
$.ajax({
type: "POST",
url: "send.php?"+data,
matth@darwin:~$ which node
matth@darwin:~$ sudo -s
root@darwin:~# which node
/home/matth/local/bin/node
$time = '2014-03-30 02:00:00';
echo strtotime($time)."\n";
$time = '2014-03-30 01:00:00';
echo strtotime($time)."\n";
var Toolbox = React.createClass({
render: function() {
return (
<div></div>
);
}
});
React.renderComponent(
var ToolboxBlock = React.createClass({
handleClick: function() {
// need to reference the div here
},
render: function() {
var type = this.props.type;
var className = 'block block-type-'+type;
var blockId = 'block-'+Math.random();
return (
// ..
submitSettings: function(e) {
e.preventDefault();
console.log($(e.target).serialize());
},
render: function() {
//...
<form action="/validate" method="post" onSubmit={this.submitSettings}>
// ...
}
getZones: function(temp) {
return temp ? this.state.tempZones : this.state.zones;
},
componentDidMount: function() {
this.setState({
zones: this.getFeatureData('zones'),
tempZones: this.getFeatureData('zones')
});
},
addZone: function() {
➜ windsor git:(master) ✗ npm update --loglevel=silly
npm info it worked if it ends with ok
npm verb cli [ '/usr/local/Cellar/node/0.10.21/bin/node',
npm verb cli '/usr/local/bin/npm',
npm verb cli 'update',
npm verb cli '--loglevel=silly' ]
npm info using npm@1.3.11
npm info using node@v0.10.21
npm info outdated updating []
npm verb exit [ 0, true ]