This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright (c) 2013 Joe Noon (https://github.com/joenoon) | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is | |
# furnished to do so, subject to the following conditions: | |
# | |
# The above copyright notice and this permission notice shall be included in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if defined?(PhusionPassenger) | |
# Rails.logger is not available at the time of adding the middleware | |
class PassengerRailsLoggerProxy | |
def info(*args) | |
if @logger ||= Rails.logger | |
@logger.info(*args) | |
end | |
end | |
end | |
PhusionPassenger.require_passenger_lib 'rack/out_of_band_gc' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# CLI wrapper to simplify outputting a doc or all docs from a cblite db. | |
# | |
# The MIT License (MIT) | |
# | |
# Copyright (c) 2015, Joe Noon | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Creates classes in Obj-C and Java that contain values from | |
# config.yaml (which can be overridden by ENV). | |
# Values are obfuscated. (Untested as to how secure this is, | |
# but the point is to do better than completely plain | |
# public api keys visible in builds/plists) | |
# The key value pairs can be accessed from React Native via: | |
# NativeModules.AppEnv.XYZ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// MailgunSender | |
// Copyright 2017 Joe Noon <[email protected]> | |
// MIT License | |
// | |
// This is a simple wrapper around mailgun.send that adds easy templating and forces | |
// tags to be used. | |
// | |
// Initialize a MailgunSender with the path to your templates, and instance of mailgun: | |
// |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const LETTERS = 'acdfgilmnoprstuw'; | |
const HASH = 7; | |
function hash(s) { | |
let hash = HASH; | |
for (let i = 0; i < s.length; i++) { | |
hash = (hash * 23 + LETTERS.indexOf(s[i])); | |
} | |
return hash; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//[understanding quaternion] | |
// - basic vector knowledge | |
// - quaternion basics | |
// - quaternion multiply | |
// - rotation with quaternion | |
// - slerp | |
// - convert quaternion to matrix | |
//[(basic) vector func] | |
var negate = function (vec) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import {View} from 'react-native'; | |
function Icon(props: {size: number, color: string, name: string, style?: any}) { | |
const SVGIcon = Icon.SVGS[props.name]; | |
if (!SVGIcon) { | |
throw new Error(`Unknown icon ${props.name}`); | |
} | |
const {style, ...rest} = props; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { observable, computed, toJS } from 'mobx'; | |
function defaultData() { | |
return { | |
text: null, | |
dataText: null, | |
type: null, | |
}; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {useComputed, useObservable, useObserver as useObserverInternal} from 'mobx-react-lite'; | |
const HOOKS = { | |
useComputed, | |
useObservable, | |
}; | |
export type MobxReactLiteHooks = typeof HOOKS; | |
// This is for my convenience, not neccessary for the pattern. | |
export * from 'mobx'; |