Skip to content

Instantly share code, notes, and snippets.

View axross's full-sized avatar
🍣
= 🍚 + 🐟 + ❤️

Kohei axross

🍣
= 🍚 + 🐟 + ❤️
View GitHub Profile
const CircularJSON = require('circular-json');
const browserify = require('browserify');
const watchify = require('watchify');
const source = require('vinyl-source-stream');
const buffer = require('vinyl-buffer');
const __bundleFuncsCache = {};
const getCachedBundleFunc = (entry, options) => {
const key = `${entry}#${CircularJSON.stringify(options)}`;
const gulp = require('gulp');
// for rollup
const rollup = require('rollup');
// for stylus and postcss
const rename = require('gulp-rename');
const plumber = require('gulp-plumber');
const stylus = require('gulp-stylus');
const postcss = require('gulp-postcss');
import 'dart:io' show HttpServer, HttpRequest;
main() {
HttpServer.bind('127.0.0.1', 8000)
.then((server) {
server.listen((HttpRequest request) {
request.response
..write('Hello, World!')
..close();
});
class HelloException implements Exception {
String cause;
HelloException(this.cause);
}
main() {
var a = 1;
try {
@axross
axross / FlatButton.tsx
Last active December 20, 2016 02:28
CSS in JS
import * as React from 'react';
import { css } from 'glamor';
import {
WHITE, MIDNIGHT,
SILVER, LIGHT_SILVER, DARK_SILVER,
RED, LIGHT_RED, DARK_RED,
BLUE, LIGHT_BLUE, DARK_BLUE,
} from '../../constants/colors';
import { SHORT_DURATION } from '../../constants/duration';
@axross
axross / SigninForm.tsx
Created December 20, 2016 04:22
Wrapped FlexBox components with CSS in JS
import { css } from 'glamor';
import { CSSProperties } from 'glamor';
import * as React from 'react';
import FlatButton from '../../presenters/atoms/FlatButton';
import Flexible, { FlexibleItem } from '../../presenters/atoms/Flexible';
import Grid, { Row, Cell } from '../../presenters/atoms/Grid';
import InputBox from '../../presenters/atoms/InputBox';
import Label from '../../presenters/atoms/Label';
type Props = {
@axross
axross / FlatButton.ts
Created December 20, 2016 07:32
CSS in JS using styled-components
import * as React from 'react';
import styled from 'styled-components';
import {
WHITE, MIDNIGHT,
SILVER, LIGHT_SILVER, DARK_SILVER,
RED, LIGHT_RED, DARK_RED,
BLUE, LIGHT_BLUE, DARK_BLUE,
} from '../../constants/colors';
import { SHORT_DURATION } from '../../constants/duration';
import { REGULAR_HORIZONTAL_MARGIN, REGULAR_RADIUS_LENGTH } from '../../constants/size';
Compiling study_lang v0.1.0 (file:///Users/axross/Dropbox/Workspace/study-rust/study_lang)
error[E0277]: the trait bound `Humanoid: Walkable` is not satisfied
--> src/main.rs:68:3
|
68 | shift(humanoid);
| ^^^^^ the trait `Walkable` is not implemented for `Humanoid`
|
= note: required by `shift`
error: aborting due to previous error
const Counter = ({ count, onIncrementClick, onDecrementClick, onIncrementAsyncClick }) => (
<div>
{count}
:
<button onClick={onIncrementClick}>+</button>
/
<button onClick={onDecrementClick}>-</button>
/
<br/>
<button onClick={onIncrementAsyncClick}>+ Async</button>
import { css } from 'glamor';
import * as React from 'react';
type Direction = 'row' | 'row-reverse' | 'column' | 'column-reverse';
type Wrap = 'nowrap' | 'wrap' | 'wrap-reverse';
type JustifyContent = 'flex-start' | 'flex-end' | 'center' | 'space-between' | 'space-around';
type AlignItems = 'flex-start' | 'flex-end' | 'center' | 'baseline' | 'stretch';
type AlignContent = 'flex-start' | 'flex-end' | 'center' | 'stretch' | 'space-between' | 'space-around';
type Length = number | string;