Skip to content

Instantly share code, notes, and snippets.

View blairanderson's full-sized avatar

Blair Anderson blairanderson

View GitHub Profile
@blairanderson
blairanderson / open-mac-apps-unidentified-developer.markdown
Created March 27, 2014 16:41
How to Open Mac Apps from an Unidentified Developer
  1. Launch System Preferences and click on it. (type command + space and type 'system preferences')
  2. From here click on the Privacy & Security icon in the top row.
  3. The General tab is where we want to be.
  4. the lock-icon in the bottom left should look unlocked. If it is not, click on the lock and type in your password. This will allow you to make changes to your settings.
  5. click "Anywhere"

Anywhere will allow any app to be opened regardless of the source or developer.

Once you've made your changes, click the lock icon again and go ahead close the window(click the little red circle x in the top left) and exit out of System Preferences altogether.

@blairanderson
blairanderson / hardcider.md
Last active August 29, 2015 14:02
Hard Cider Recipe

Recipe Type: All Grain

Yeast: Red Star Montrachet

Yeast Starter: Nope

Additional Yeast or Yeast Starter: Nope

Batch Size (Gallons): 5

@blairanderson
blairanderson / introrx.md
Last active August 29, 2015 14:03 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing

The introduction to Reactive Programming you've been missing

(by @andrestaltz)

So you're curious in learning this new thing called (Functional) Reactive Programming (FRP).

Learning it is hard, even harder by the lack of good material. When I started, I tried looking for tutorials. I found only a handful of practical guides, but they just scratched the surface and never tackled the challenge of building the whole architecture around it. Library documentations often don't help when you're trying to understand some function. I mean, honestly, look at this:

Rx.Observable.prototype.flatMapLatest(selector, [thisArg])

Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.

@blairanderson
blairanderson / learning-to-read.md
Last active August 29, 2015 14:04
Reading selection: “Learning to Read” excerpt from The Autobiography of Malcolm X

http://www.amazon.com/The-Autobiography-Malcolm-Told-Haley/dp/0345350685

MALCOLM X

Born Malcolm Little on May 19, 1925, Malcolm X was one of the most articulate and powerful leaders of black America during the 1960s. A street hustler convicted of robbery in 1946, he spent seven years in prison, where he educated himself and became a disciple of Elijah Muhammad, founder of the Nation of Islam. In the days of the civil rights movement, Malcolm X emerged as the leading spokesman for black separatism, a philosophy that urged black Americans to cut political, social, and economic ties with the white community. After a pilgrimage to Mecca, the capital of the Muslim world, in 1964, he became an orthodox Muslim, adopted the Muslim name El Hajj Malik El-Shabazz, and distanced himself from the teachings of the black Muslims. He was assassinated in 1965. In the following excerpt from his autobiography (1965), coauthored with Alex Haley and published the year of his death, Malcolm X describes his self-education.

@blairanderson
blairanderson / code.md
Last active August 29, 2015 14:05
javascript is fun

How would you optimize this for readability,fun...?

I need to return null if the value cannot be found for var lastName = contact.properties.lastname.value;

basically if a nested property doesn't exist... what are some cool ways to prevent "Cannot read prop X of undefined"

current solution:

@blairanderson
blairanderson / devise-twitter-facebook-linkedin.md
Last active August 29, 2015 14:06
devise twitter facebook linkedin from: http://sourcey.com/rails-4-omniauth-using-devise-with-twitter-facebook-and-linkedin/ - mostly to keep in git and let people fork/etc. credit to the author.

There are quite a few OAuth solutions out there, but I want to share the one we use since it allows you to intelligently link multiple OAuth identities with a single user entity. If you use 90% of the code examples on the Internet you will wind up with a new user entity each time the user signs in with a different OAuth provider, and a bunch of very confused users.

The OAuth provider that throws a spanner in the works and adds convolution to our code is Twitter. Unlike other providers, Twitter doesn’t share their user’s email address, so we need to add an extra step to get it from the user. More info on that here.

Thanks to everyone who submitted comments and changes! For a list of code changes see here.

A quick word of warning: This isn’t a complete code example, it’s a hackers guide to using OmniAuth in Rails the right way. If you’re looking for a full fledged demo then there are plenty available on Github.

Basic Implementation So, without further ado, here is the code:

@blairanderson
blairanderson / server.js
Created October 2, 2014 22:46
simple node server
var fs = require('fs')
var path = require('path')
var express = require('express')
var app = express();
app.use(express.static(path.join(__dirname, 'public')));
app.get('*', function(req, res){
res.pipe(fs.createReadStream(path.join(__dirname, 'public', 'index.html')))
@blairanderson
blairanderson / modules.md
Last active August 29, 2015 14:07
Node Module Overview

Typical OauthFlow:(example is github)

  1. Redirect users to request access
  2. Service redirects back to your site(with code) after user approves
  3. Use code to get access token to access the API

Marketo OAuth Flow:

  1. Auth path is undocumented or does not exist
@blairanderson
blairanderson / desc.md
Created November 3, 2014 21:59
Simple CSS Columns With Border Separators