Skip to content

Instantly share code, notes, and snippets.

import React from 'react';
type State = {
isLoading: boolean;
data: object;
};
const initialState = {
isLoading: true,
data: undefined,
@atmartins
atmartins / backup-mongo-s3.sh
Created February 13, 2017 03:43
Back up a mongo db, then sync entire persistent data folder to s3. Includes instructions.
#!/bin/bash
# Backup Mongo Db and Sync to S3
#
# Written by Aaron Martins
# [email protected]
# Feb 2017
#
# Note: Current, only local mongo (passwordless) supported on port 27017.
#
@atmartins
atmartins / atom_snippets.cson
Created November 22, 2016 02:19
Atom Snippets
# Your snippets
#
# Atom snippets allow you to enter a simple prefix in the editor and hit tab to
# expand the prefix into a larger code block with templated values.
#
# You can create a new snippet in this file by typing "snip" and then hitting
# tab.
#
# An example CoffeeScript snippet to expand log to console.log:
#
@atmartins
atmartins / fadein.css
Created November 22, 2016 02:16 — forked from benjaminfisher/fadein.css
CSS for fadein keyframes
/* name, duration, timing function, delay, fill mode */
-webkit-animation: fadeIn 700ms ease-in-out 1s both;
animation: fadeIn 700ms ease-in-out 1s both;
@-webkit-keyframes fadeIn{from{opacity:0}to{opacity:1}}
@keyframes fadeIn{from{opacity:0}to{opacity:1}}
@atmartins
atmartins / html5_template.html
Created November 22, 2016 02:14 — forked from nathansmith/html5_template.html
Simple HTML5 Template
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="x-ua-compatible" content="ie=edge, chrome=1" />
<title>untitled</title>
<link rel="stylesheet" href="" />
</head>
<body>
@atmartins
atmartins / gist:b9dbe8a4fa6080ae61bd
Created October 15, 2015 20:41 — forked from Mithrandir0x/gist:3639232
Difference between Service, Factory and Provider in AngularJS
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/
// author: Pawel Kozlowski
var myApp = angular.module('myApp', []);
//service style, probably the simplest one
myApp.service('helloWorldFromService', function() {
this.sayHello = function() {
return "Hello, World!"