Skip to content

Instantly share code, notes, and snippets.

View giacomorebonato's full-sized avatar

Giacomo Rebonato giacomorebonato

View GitHub Profile
import React, { Component } from 'react'
import Firebase from 'firebase'
import { FIREBASE_URL } from '../../lib/consts'
import denormalize from './lib/denormalize'
export var FirebaseConnect = (ComposedComponent, collections) => class extends Component {
constructor (props) {
super(props)
this.state = {
rootRef: new Firebase(FIREBASE_URL),
@giacomorebonato
giacomorebonato / webpack.config.js
Last active May 25, 2016 12:58
Really basic Webpack configuration
var webpack = require('webpack')
var path = require('path')
var NODE_ENV = process.env.NODE_ENV || 'development'
var conf = {
entry: {
'front-end': [path.join(__dirname, '/client/front/front-end.js')],
'back-end': [path.join(__dirname, '/client/back/back-end.js')]
},
output: {
@giacomorebonato
giacomorebonato / index.ts
Created July 12, 2016 10:02
Stores instantiation
import AuthStore from './AuthStore'
import NotificationsStore from './NotificationsStore'
import SampleStore from './SampleStore'
import UIStore from './UIStore'
const notificationsStore = new NotificationsStore()
const stores = {
notificationsStore,
authStore: new AuthStore(notificationsStore),
@giacomorebonato
giacomorebonato / notifications.css
Created July 12, 2016 10:12
Notifications styles
:global .notification-enter {
opacity: 0.01;
}
:global .notification-enter.notification-enter-active {
opacity: 1;
transition: opacity 500ms ease-in;
}
:global .notification-leave {
import { observable, action } from 'mobx'
import objectAssign = require('object-assign')
class SampleStore {
constructor (data?) {
if (data) {
this.setData(data)
} else if (window['data']) {
let wData = window['data'] as any
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script>
var data = {{data | safe}}
</script>
<title>Typescript boilerplate</title>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel='stylesheet' />
<link href='https://fonts.googleapis.com/css?family=Roboto' rel='stylesheet' type='text/css' />
@giacomorebonato
giacomorebonato / Component_With_Loader.js
Last active August 17, 2016 12:33
ReactJS Component with Loader
import React from 'react'
class Component_1 extends React.Component {
constructor (props) {
super(props)
this.state = {
loading: true
}
}
### Keybase proof
I hereby claim:
* I am giacomorebonato on github.
* I am grebonato (https://keybase.io/grebonato) on keybase.
* I have a public key ASCjqKFvulYeQyfZVXCFg1kBEiTMXMvyJyuDMqRrR4grtAo
To claim this, I am signing this object:
@giacomorebonato
giacomorebonato / personal.sh
Created October 7, 2019 13:22
Personal shell
alias cbn="git branch | grep '^\*' | cut -d' ' -f2 | pbcopy && echo \"branch name copied to clipboard\""
alias burp="brew upgrade && brew update"
@giacomorebonato
giacomorebonato / sequelize-schema-file-generator.js
Last active October 18, 2019 20:32 — forked from manuelbieh/sequelize-schema-file-generator.js
Automatically generates migration files from your sequelize models
import db from './models'
import del from 'del'
import fs from 'fs'
import path from 'path'
let { sequelize } = db
const migrations_path = path.join(__dirname, '/migrations/')
del([migrations_path])
.then(() => {