Skip to content

Instantly share code, notes, and snippets.

View todo_server.exs
defmodule Todo.Server do
use GenServer
def init(_) do
{:ok, Todo.List.new}
end
def start do
GenServer.start(Todo.Server, nil)
end
View VDOM.elm
module VDOM (toString) where
import Html
import Native.VDOM
toString : Html.Html -> String
toString html =
Native.VDOM.toString html
View docker-compose.yml
mongodb:
image: mongo
volumes:
- ./mongodb-data:/data/db
genghis:
image: aegypius/genghis
links:
- mongodb:db
View requestHTML-Promise.js
function requestHTML(url) {
return new Promise(function(resolve, reject){
request(url, function (err, res, body) {
if (err) reject(err);
if (!body) reject(new Error('not an html'));
resolve(body);
});
});
});
View for-of es5
try {
for (var _iterator = ViewportAngles[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
var angle = _step.value;
var checked = this.props.viewAngle === angle;
viewAngleOptions.push(React.createElement(
"div",
{ className: "viewAngle" },
React.createElement("input", {
type: "radio",
View for-of
for (let angle of ViewportAngles) {
var checked = this.props.viewAngle === angle;
viewAngleOptions.push(
<div className="viewAngle">
<input
type="radio"
name="viewportAngles"
id={angle}
value={angle}
key={angle}
View package.json
{
"main": "src/app.jsx",
"dependencies": {
"flux": "^2.0.1",
"keymirror": "~0.1.0",
"object-assign": "^1.0.0",
"underscore": "^1.8.2",
"immutable": "^3.6.2",
"react": "^0.12.0"
},
@burabure
burabure / metaboxes.php
Created Mar 4, 2013
creating metaboxes
View metaboxes.php
if ( function_exists( 'slt_cf_register_box') )
add_action( 'init', 'organizer_info' );
function organizer_info() {
slt_cf_register_box( array(
'type' => 'post',
'title' => 'Organizer Info',
'id' => 'organizer-info',
'context' => 'normal',
You can’t perform that action at this time.