Skip to content

Instantly share code, notes, and snippets.

@th3mon
th3mon / Header.tsx
Created January 10, 2020 05:53
example code of functional component which use style attribute
import React from 'react';
const Header = ({children}) => {
return (
<header
style={{
color: '#666',
backgroundColor: '#333',
}}
>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/expect/1.20.2/expect.min.js"></script>
<script src="https://wzrd.in/standalone/deep-freeze@latest"></script>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/expect/1.20.2/expect.min.js"></script>
<script src="https://wzrd.in/standalone/deep-freeze@latest"></script>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/expect/1.20.2/expect.min.js"></script>
<script src="https://wzrd.in/standalone/deep-freeze@latest"></script>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/expect/1.20.2/expect.min.js"></script>
<script src="https://wzrd.in/standalone/deep-freeze@latest"></script>
@th3mon
th3mon / app.js
Last active September 21, 2017 14:39
Redux, simple app with React
'use strict';
console.clear();
var counter = function counter(state, action) {
if (state === undefined) state = 0;
switch (action.type) {
case 'INCREMENT':
return state + 1;
case 'DECREMENT':
@th3mon
th3mon / app.js
Last active September 21, 2017 14:19
Redux, simple app
'use strict';
console.clear();
var counter = function counter(state, action) {
if (state === undefined) state = 0;
switch (action.type) {
case 'INCREMENT':
return state + 1;
case 'DECREMENT':
@th3mon
th3mon / counter.reducer.js
Last active September 21, 2017 13:47
Redux, reducer
'use strict';
console.clear();
var counter = function counter(state, action) {
if (state === undefined) state = 0;
switch (action.type) {
case 'INCREMENT':
return state + 1;
case 'DECREMENT':
@th3mon
th3mon / dist.js
Last active January 28, 2017 17:54
aurelia dist task
import gulp from 'gulp';
import project from '../aurelia.json';
import build from './build';
import del from 'del';
function dist() {
let defaults = {
index: 'index.html',
dist: {
root: 'dist',
@th3mon
th3mon / console.sublime-snippet
Last active August 29, 2015 14:09
Sublime Text snippets
<snippet>
<content><![CDATA[
console.${1:log}($2);
]]></content>
<tabTrigger>cl</tabTrigger>
</snippet>