Skip to content

Instantly share code, notes, and snippets.

@danscan
danscan / keybase.md
Created January 17, 2021 19:37
keybase.md

Keybase proof

I hereby claim:

  • I am danscan on github.
  • I am danscan (https://keybase.io/danscan) on keybase.
  • I have a public key ASAS_Adf3xZSUSirUuF9Cfjd_Bf9PZ_diAinf-zLiouIfwo

To claim this, I am signing this object:

Backathon

See what the other hackers are working on. If you like an hack, play with it.
If not, remove it.

Load Dependencies

_                   = require 'underscore'                  # documentcloud/underscore
@danscan
danscan / policy.js
Last active January 25, 2016 17:03
Policy function
function requestUserOwnsPost(requestUser, post) {
return requestUser.id === post.owner;
}
const db = {
postsById: {
'2': {
id: 2,
owner: 1,
body: 'hey',
@danscan
danscan / policy.js
Created January 25, 2016 16:55
Policy function
const db = {
usersBySessionToken: {
'1': {
id: 1,
name: 'Dan',
},
},
postsById: {
'2': {
@danscan
danscan / .babelrc
Last active November 18, 2015 20:32
react-native-charts example .babelrc
{
"retainLines": true,
"compact": true,
"comments": false,
"stage": 1,
"whitelist": [
"es6.arrowFunctions",
"es6.blockScoping",
"es6.classes",
"es6.destructuring",
@danscan
danscan / idea.js
Created September 3, 2015 20:43
Safely expressing schema remapping in legacy APIs as append-only write streams.
// Writes: Append-Only Stream
{ operation: 'write', key: 'users.e36a7c158ee2a92143967b7a860f4ea5.first_name', value: 'Dan', date: 'yesterday', clientVersion: 'yesterday' }
{ operation: 'write', key: 'users.e36a7c158ee2a92143967b7a860f4ea5.first_name', value: 'Daniel', date: 'yesterday', clientVersion: 'yesterday' }
{ operation: 'write', key: 'users.e36a7c158ee2a92143967b7a860f4ea5.first_name', value: 'Daniel', date: 'yesterday', clientVersion: 'yesterday' }
{ operation: 'rename key', key: 'users.*.first_name', name: 'users.*.firstName', date: 'today' }
{ operation: 'write', key: 'users.e36a7c158ee2a92143967b7a860f4ea5.first_name', value: 'Esteban', date: 'today', clientVersion: 'yesterday' }
{ operation: 'write', key: 'users.e36a7c158ee2a92143967b7a860f4ea5.first_name', value: 'Justin', date: 'today', clientVersion: 'today' }
// Present-Time value of `users.e36a7c158ee2a92143967b7a860f4ea5`
{ firstName: 'Esteban', first_name: 'Justin' }
@danscan
danscan / index.js
Created August 30, 2015 21:16
Animated Bar
import React from 'react-native'
const { Animated, View } = React
import styles from './styles'
// Configuration Constants
const INITIAL_VALUE_SCALE = 0
const DESTINATION_VALUE_SCALE = 1
const VALUE_SCALE_SPRING_FRICTION = 5
export default class Bar extends React.Component {
@danscan
danscan / nav.md
Created June 25, 2015 00:55
Modeling navigation in React Native

Router Nav

# (Not REST... Pages/Views (like a website)) ... or maybe resourceful with scaffolding
* * *

/ -> session.user ? /activity : /authenticate

# Main Nav
/activity
@danscan
danscan / PointSequence.swift
Created June 8, 2015 14:29
PointSequence.swift
//
// PointSequence.swift
// ThoughtPad
//
// Created by Daniel Scanlon on 6/5/15.
// Copyright (c) 2015 Present. All rights reserved.
//
import UIKit