Skip to content

Instantly share code, notes, and snippets.

View andreypopp's full-sized avatar
🏠
Working from home

Andrey Popp andreypopp

🏠
Working from home
View GitHub Profile
from imagination.tulip import subprocess
p = subprocess.run("somecmd", ["arg1", "arg2"])
# process's pid
p.pid
# send signal to process
p.kill(subprocess.SIGINT)
var Page = ReactApp.createPage(function(props) {
return <html><body>Hello, world</body></html>;
});
macro attributes {
case {_()} => {
return #{null}
}
case {_($($name:ident = $val:expr) (,) ...)} => {
return [makeDelim('{}', #{$($name: $val) (,) ...})]
}
}
macro component {
var Page = React.createClass({
render: function() {
return markup html {
head {
meta(charset="utf8")
title { "Page" }
}
body {
div(className="wrapper")
}
var Tappable = React.createClass({
render: function() {
return <div onClick={this.onClick} onTouchTapEnd={this.onClick}>{this.props.children}</div>;
}
});
...
<Tappable onClick={this.handle}>Some stuff</Tappable>
<!doctype html>
<input id="query" type="text"></input>
<button id="search">Search</button>
<p id="results"></p>
<script src="bundle.js"></script>
/**
* Copyright 2013 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@andreypopp
andreypopp / example.html
Created November 19, 2013 15:06
unnamed: React component
<!doctype>
<html>
<head>
<title>Component Example</title>
<link rel="stylesheet" href="bundle.css">
<style>
body {
padding: 10px;
}
</style>
@andreypopp
andreypopp / example.html
Created November 19, 2013 15:17
unnamed: React component
<!doctype>
<html>
<head>
<title>Component Example</title>
<link rel="stylesheet" href="bundle.css">
<style>
body {
padding: 10px;
}
</style>
@andreypopp
andreypopp / example.html
Created November 19, 2013 15:22
unnamed: React component
<!doctype>
<html>
<head>
<title>Component Example</title>
<link rel="stylesheet" href="bundle.css">
<style>
body {
padding: 10px;
}
</style>