Skip to content

Instantly share code, notes, and snippets.

View ekryski's full-sized avatar

Eric Kryski ekryski

View GitHub Profile
@ekryski
ekryski / keybase.md
Created September 12, 2019 04:51
keybase.md

Keybase proof

I hereby claim:

  • I am ekryski on github.
  • I am ekryski (https://keybase.io/ekryski) on keybase.
  • I have a public key ASAF7mDLWRpRkILTq2BjwM_mQd4Ywi0KfZqidQdH0hN90Ao

To claim this, I am signing this object:

@ekryski
ekryski / readme.md
Created April 17, 2017 18:53 — forked from marshallswain/readme.md
FeathersJS: Better permissions

Better Permissions Control

We have introduced 3 new hooks and 2 new middleware as part of feathers-permissions that give you much more flexibility and control over access permissions than was previously possible. Permissions are stored in the database on the entity record that needs to have access permissions checked (typically a user). They look like this:

[
    '*', // all services, all methods, all docs
    'users:*', // all methods on users service
    'users:remove:*', // can remove any user
    '*:remove', // can remove on any service
@ekryski
ekryski / circle.yml
Last active October 28, 2022 14:46
Using Yarn with CircleCI and Heroku
machine:
pre:
- mkdir ~/.yarn-cache
node:
version: stable
dependencies:
pre:
- curl -o- -L https://yarnpkg.com/install.sh | bash
cache_directories:
- ~/.yarn-cache
@ekryski
ekryski / readme.md
Last active March 9, 2016 17:18
Feathers main app dependencies
# Install core dependencies
npm install feathers feathers-hooks

# Install REST and Socket.io
npm install feathers-socketio feathers-rest body-parser

# Install database, error handling, and auth dependencies
npm install feathers-errors feathers-memory feathers-authentication 
@ekryski
ekryski / server.js
Last active April 11, 2017 06:46
Feathers Memory Server Configuration with Authentication
const feathers = require('feathers');
const rest = require('feathers-rest');
const socketio = require('feathers-socketio');
const hooks = require('feathers-hooks');
const memory = require('feathers-memory');
const authentication = require('feathers-authentication');
const local = require('feathers-authentication-local');
const jwt = require('feathers-authentication-jwt');
const bodyParser = require('body-parser');
const handler = require('feathers-errors/handler');
@ekryski
ekryski / react-native.js
Last active April 11, 2017 06:37
Feathers React Native Configuration
import { AsyncStorage } from 'react-native';
import feathers from 'feathers/client'
import hooks from 'feathers-hooks';
import socketio from 'feathers-socketio/client'
import authentication from 'feathers-authentication-client';
if(!global._babelPolyfill) { require('babel-polyfill'); }
// Need to require instead of import so we can set the user agent first
const io = require('socket.io-client/socket.io');
@ekryski
ekryski / browser.html
Last active April 11, 2017 06:41
Feathers Browser Configuration
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Feathers Example</title>
</head>
<body>
<h1>Welcome to Feathers</h1>
<p>Open up the console in your browser.</p>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/core-js/2.1.4/core.min.js"></script>
@ekryski
ekryski / browser.js
Created March 4, 2016 08:34
Basic Feathers App
const host = 'http://localhost:3030';
let socket = io(host, {
transport: ['websockets']
});
// Set up Feathers client side
let app = feathers();
// Register hooks module
app.configure(feathers.hooks());
// Register socket.io
@ekryski
ekryski / app.js
Last active February 19, 2019 20:20
How to use socket.io in React Native
// You need to set `window.navigator` to something in order to use the socket.io
// client. You have to do it like this in order to use the debugger because the
// debugger in React Native runs in a webworker and only has a getter method for
// `window.navigator`.
window.navigator.userAgent = 'ReactNative';
// Need to require instead of import so we can set the user agent first
// This must be below your `window.navigator` hack above
const io = require('socket.io-client/socket.io');
const socket = io('http://chat.feathersjs.com', {
@ekryski
ekryski / gist:3ab7d82505684ecbb891
Created January 9, 2016 20:08 — forked from jjb/gist:7389552
Ruby 2.1 memory configuration

This all applies to Ruby 2.1. In some cases a setting is not available in 2.0, this is noted. There is also a different with 1.9, 1.8, and REE --- these are not noted.

All the relevant code is in https://github.com/ruby/ruby/blob/trunk/gc.c

RUBY_HEAP_MIN_SLOTS

default: 10000

The number of heap slots to start out with. This should be set high enough so that your app has enough or almost enough memory after loading so that it doesn't have to allocate more memory on the first request (althogh this probably isn't such a big deal for most apps).

(todo: figure out how big a slot is. i think the answer can be infered from this code.)