Skip to content

Instantly share code, notes, and snippets.

import compat from 'preact/compat'
export * from 'preact/compat';
export default compat;
@cj
cj / UserList.jsx
Last active November 10, 2018 23:26
import m from 'mithril'
import User from '../models/User'
const Container = '.p-10.bg-pri'
const UserListItem = {
view({ attrs: { user } }) {
return (
<div class="user-list">
{user.firstName} {user.lastName}
@cj
cj / json
Created January 11, 2018 04:08
{
"before": [
"<leader>",
"u"
],
"after": [],
"commands": [
{
"command": "redo",
"args": []
fetch('https://api.graph.cool/simple/v1/cixos23120m0n0173veiiwrjr', {
method: 'post',
mode: 'cors',
headers: new Headers({'content-type': 'application/json'}),
body: JSON.stringify({
operationName: null,
query: `{
Movie(id: "cixos5gtq0ogi0126tvekxo27") {
id
title
@cj
cj / gitlab.sh
Created February 24, 2016 06:13 — forked from sanand0/gitlab.sh
Installing Gitlab
# Gitlab 5.1: https://github.com/gitlabhq/gitlabhq/blob/5-1-stable/doc/install/installation.md
# Set up an AWS EC2 Ubuntu 12.04 LTS Server.
# Use ap-southeast-1b: spot pricing is smoother
# Log in as ubuntu@
sudo apt-get -y update
sudo apt-get -y upgrade
# Install the required packages.
@cj
cj / Gemfile
Last active August 29, 2015 14:25
gem 'roda', '2.5.0'
gem 'wedge', github: 'wedge/wedgeio'
#!/bin/sh
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
#!/bin/bash
if [[ -f .env ]]; then
eval "$(awk '/^[A-Z]/ { print "export " $0 }' .env)"
if [[ $# -gt 0 ]]; then
"$@"
elif [[ -z $PS2 ]]; then
$SHELL
@cj
cj / hash.rb
Created March 4, 2014 05:06 — forked from rmw/hash.rb
class Hash
# options:
# :exclude => [keys] - keys need to be symbols
def to_ostruct_recursive(options = {})
convert_to_ostruct_recursive(self, options)
end
private
def convert_to_ostruct_recursive(obj, options)
result = obj
@cj
cj / app.rb
Created February 21, 2014 19:56
Cuba.define do
on get, 'assets' do
run Assets::Routes
end
on root do
res.write view("home/index")
end
end