Skip to content

Instantly share code, notes, and snippets.

View tclain's full-sized avatar

Timothée Clain tclain

View GitHub Profile
<!-- your html code here !-->
<html>
<head>
<link href="https://fonts.googleapis.com/css?family=PT+Sans|Roboto+Slab" rel="stylesheet">
<title>TESTING!!</title>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
cd ~
SUBLIME_FOLDER="Library/Application Support/Sublime Text 3/Installed Packages"
curl -L https://github.com/emmetio/pyv8-binaries/raw/master/pyv8-osx-p3.zip > v8.zip
mkdir -p $SUBLIME_FOLDER/PyV8
cd $SUBLIME_FOLDER/PyV8
unzip $HOME/v8.zip
@tclain
tclain / view.js
Created June 20, 2018 17:06
simplest view layer in javascript ever (with jquery)
import $ from 'jquery';
const view = ({
template,
state,
el,
} = {}) => {
let state = {...state};
const render = () => {
const interpolated = template(state);
@tclain
tclain / simple-pattern-match-array-based.js
Created May 22, 2018 15:11
attempt to implement pattern match
import { strictEqual } from '../utils/equality';
import isFunction from 'lodash/isFunction';
/**
* simple value mapper for javascript using strict equality
*
* spec is an object that associate enums like (strings) to arbitrary value / function
* for instance:
*
* const spec = {
@tclain
tclain / css-string-theme.js
Created May 11, 2018 22:04
css string to styled components theme
import flow from 'lodash.flow';
import set from 'lodash.set';
export const cssString = `
:root {
--root: #a;
--sub-theme__variable: #a;
--sub-theme__variable2: #a1;
--sub-theme__variable3__a2: #cecea2;
--sub-theme__variable3__a3: #cecea3;
@tclain
tclain / styled-components-utils.js
Last active May 11, 2018 22:05
styled-components utils
import styled, { css } from 'styled-components';
import at from 'lodash.at';
export const Blue = css`
border-bottom-color: blue;
`
export const Red = css`
border-top-color: red;

Pattern matching

import scala.util.Random

val x: Int = Random.nextInt(10)

x match { case 0 => "zero" case 1 => "one" case 2 => "two"

fourseven:scss
alanning:roles
accounts-base
accounts-password
aldeed:simple-schemas
dburles:collection-helpers
matb33:collection-hooks
momentjs:moment
fourseven:scss
alanning:roles
accounts-base@1.2.13
accounts-password@1.3.0
poetic:materialize-scss
useraccounts:core
useraccounts:materialize
useraccounts:iron-routing
iron:router
softwarerero:accounts-t9n
@tclain
tclain / actions.js
Created June 14, 2016 08:39
Redux CheatSheet
export const LIST_ALL_ITEMS = "LIST_ALL_ITEMS";
export function listAllItems(page = 0, limit = 30){
return {
type : LIST_ALL_ITEMS,
page,
limit
}
}
export const CREATE_ITEM = "CREATE_ITEM";