Skip to content

Instantly share code, notes, and snippets.

View blittle's full-sized avatar
🇺🇦

Bret Little blittle

🇺🇦
View GitHub Profile
@blittle
blittle / angular-decorator.js
Created May 29, 2015 23:07
Angular Decorator
/**
* Workaround to make defining and retrieving angular modules easier and more intuitive.
*/
(function(angular) {
var origMethod = angular.module;
var alreadyRegistered = {};
/**
import React from 'react';
import { Router, Route } from 'react-router';
import { createStore, combineReducers, applyMiddleware } from 'redux';
import { Provider } from 'react-redux';
import thunk from 'redux-thunk';
import App from './app.component';
import Tabs from './tabs/tabs.component';
import Dashboard from 'src/dashboard/dashboard.component';
@blittle
blittle / gist:7696111
Created November 28, 2013 18:11
LehiWest Angular Sample
<!DOCTYPE HTML>
<html>
<head>
<title></title>
<meta http-equiv="X-UA-Compatible" content="chrome=1"/>
<link rel="stylesheet" href="http://yui.yahooapis.com/pure/0.3.0/pure-min.css"/>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.3/angular.min.js"></script>
</head>
<body ng-app="myApp">
<div ng-controller="MyController">
const PricingWrap = function ({props}) {
return <div className="pricing" style={{ opacity: purchasing ? 0.25 : '' }}>
{props.children}
</div>
}
const Pricing = React.createClass({
// ...
render() {
// ...
@blittle
blittle / 1.js
Last active April 13, 2016 17:26
Comparison
const Pricing = React.createClass({
// ...
render() {
// ...
return (
<div className="pricing" style={{ opacity: purchasing ? 0.25 : '' }}>
{purchaseError ? (
<div className="purchase-complete">
<h2 style={{ color: 'hsl(10, 50%, 50%)' }}>Oops!</h2>
<p>
@blittle
blittle / config.js
Last active June 1, 2016 16:08
Sofe Plugin Middlware
System.config({
sofe: {
manifest: {
"someInternalService": "http://somelocation.com/service-1.0.0.js"
},
manifestUrl: 'https://somelocation.com/available-services.json',
middleware: {
preLocate: (load, locate) => {
},

Keybase proof

I hereby claim:

  • I am blittle on github.
  • I am blittle (https://keybase.io/blittle) on keybase.
  • I have a public key whose fingerprint is 6CDE 15CB DA14 991D 7FD4 852F 3029 2350 C47D 87EC

To claim this, I am signing this object:

// Static imports
import auth from 'auth-service!sofe';
const user = auth.getLoggedInUser();
// Asynchronous imports
System.import('auth-service!sofe')
.then(auth => auth.getLoggedInUser());
@blittle
blittle / test.js
Last active January 6, 2017 00:24
import {catchAsyncStacktrace} from 'auto-trace';
function getPost(post) {
return fetch(`https://jsonplaceholder.typicode.com/posts/${post.id}`)
.then(resp => {
if (resp.ok) return resp.json();
else throw `Error retrieving post with id: ${post.id}`;
})
}

A couple thoughts about http://www.nationalreview.com/article/444370/donald-trump-refugee-executive-order-no-muslim-ban-separating-fact-hysteria

1)

In 2002, the United States admitted only 27,131 refugees. It admitted fewer than 50,000 in 2003, 2006, and 2007. As for President Obama, he was slightly more generous than President Bush, but his refugee cap from 2013 to 2015 was a mere 70,000, and in 2011 and 2012 he admitted barely more than 50,000 refugees himself.

So we didn't admit many refugees under Bush or Obama. So three wrongs now make a right?

2)