Skip to content

Instantly share code, notes, and snippets.

View rwoody's full-sized avatar

Ryan rwoody

  • Texas
View GitHub Profile
@rwoody
rwoody / .gitattributes
Created April 19, 2018 13:25
Unity GitHub
## Unity ##
*.cs diff=csharp text
*.cginc text
*.shader text
*.mat merge=unityyamlmerge eol=lf
*.anim merge=unityyamlmerge eol=lf
*.unity merge=unityyamlmerge eol=lf
*.prefab merge=unityyamlmerge eol=lf
Verifying my Blockstack ID is secured with the address 17U4YcEJaFCi6ZaKYdxnCYZ6ARzuCaWzHw https://explorer.blockstack.org/address/17U4YcEJaFCi6ZaKYdxnCYZ6ARzuCaWzHw
@rwoody
rwoody / table_to_json.pg.sql
Last active December 7, 2017 13:55
PostgreSQL - Queries returned as JSON
; Outputs 1 json row per line.
; Eg.:
; {"foo": "bar"}
; {"baz": "qux"}
copy (
select row_to_json(t)
from (select * from users) t
) to '/Users/ryan/Desktop/users.json';
------ Other modifications ------
@rwoody
rwoody / auth-1.js
Last active December 1, 2017 19:28
Graphql Auth
const checkScropeAndResolve = (scope, expectedScope, controller) => {
const hasScope = scope.includes(expectedScope)
if (! expectedScopes.length || hasScope) {
return controller.apply(this)
}
}
const controller = model.getArticles(context.user.id)
const resolvers = {
@rwoody
rwoody / tslint.json
Created November 28, 2017 21:37
Typescript Tidbits
{
"rules": {
"align": [
false,
"parameters",
"arguments",
"statements"
],
"ban": false,
"class-name": true,
@rwoody
rwoody / ObservableEither.js
Created November 28, 2017 00:00 — forked from paulvictor/ObservableEither.js
Monad Transformer combining Observable and Either to handle non-determinism, async and error handling
"use strict"
var R = require("ramda");
var Sequelize = require("sequelize");
var Either = require("fantasy-eithers");
var Left = Either.Left
var Right = Either.Right
var Observable = require("rx").Observable;
var rx = require("rx");
var EitherHelpers = require("fantasy-contrib-either")
@rwoody
rwoody / .editorconfig
Created October 25, 2017 14:34
Editorconfig - PHP
root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
trim_trailing_whitespace = true
[*.php]

Keybase proof

I hereby claim:

  • I am rwoody on github.
  • I am rwoody (https://keybase.io/rwoody) on keybase.
  • I have a public key whose fingerprint is 7ABB 2A9B E322 25B1 CA6F 554C 859F 8465 77D9 695F

To claim this, I am signing this object:

@rwoody
rwoody / UserSchema.js
Created April 14, 2017 15:04
Mongoose User Password middleware
import encryptPassword, {comparePassword} from './encryptPassword'
/**
* Password hash middleware.
*/
UserSchema.pre('save', function (next) {
const user = this;
if (!user.isModified('password')) { return next(); }
encryptPassword(user.password).then(hash => {

Keybase proof

I hereby claim:

  • I am rwoody on github.
  • I am rwoody (https://keybase.io/rwoody) on keybase.
  • I have a public key whose fingerprint is 0D8F E5D5 B4CB 90C9 62A7 0FC3 B705 107C 51B9 F3AD

To claim this, I am signing this object: