Skip to content

Instantly share code, notes, and snippets.

@woeye
woeye / Editor.js
Last active June 27, 2018 11:48
PoC for an inline editor in React
import React from "react";
import ReactDOM from "react-dom";
class Editor extends React.Component {
constructor(props) {
super(props);
this.inputRef = React.createRef();
this.state = {
editMode: false,
value: "hello world"
@woeye
woeye / gist:3748641
Created September 19, 2012 09:17
Compiling node 0.6.19 on Mountain Lion using homebrew
require 'formula'
class Node < Formula
homepage 'http://nodejs.org/'
url 'http://nodejs.org/dist/v0.6.19/node-v0.6.19.tar.gz'
sha1 'f6c5cfbadff4788ac3a95f8263a0c2f4e07444b6'
head 'https://github.com/joyent/node.git'
devel do
@woeye
woeye / gist:2989064
Created June 25, 2012 14:42
Using underscore in node.js
var _ = require('underscore');
var a = {
foo: 'foo'
};
var b = {
moo: 'moo'
};
@woeye
woeye / gist:2635782
Created May 8, 2012 14:45
Using the Twitter Streaming API from node.js
var https = require('https'),
http = require('http'),
querystring = require('querystring');
var postData = querystring.stringify({
delimited: 'length',
track: '#wow'
});
var options = {
@woeye
woeye / create_view_yui_3_5_0_pr4.js
Created March 23, 2012 15:18
Creating a view in YUI 3.5.0PR4
YUI().use('app', 'view', function(Y) {
// Configure all views
/* This one won't work - because Y.HomeView is an instance already
Y.HomeView = new Y.View();
Y.HomeView.render = function() {
Y.log('inside HomeView');
return this;
};*/
@woeye
woeye / yui_dnd_sample.html
Created February 8, 2012 14:25
How to use YUI to enable reordering of elements using drag & drop
<!DOCTYPE html>
<html>
<head>
<script src="http://yui.yahooapis.com/3.4.1/build/yui/yui-min.js"></script>
<style>
.wrapper {
position: relative;
width: 300px;
border: 1px solid #555;
<!DOCTYPE html>
<html>
<head>
<script src="http://yui.yahooapis.com/3.4.1/build/yui/yui-min.js"></script>
</head>
<body>
<div id="marker"></div>
<script>
YUI().use('node', 'history', function(Y) {