Skip to content

Instantly share code, notes, and snippets.

View ekryski's full-sized avatar

Eric Kryski ekryski

View GitHub Profile
var AppConstants = require('../constants/constants');
var AppDispatcher = require('../dispatchers/app');
var Connections = require('../api/connection');
var ConnectionActions = {
loadConnections: function() {
Connections.find({}, function(error, connections){
if (error) {
AppDispatcher.handleViewAction({
action: AppConstants.LOAD_CONNECTIONS_FAIL,
@ekryski
ekryski / everyauth-override-example
Created July 8, 2011 16:37
Everyauth Functions Overriding
, validateRegistration: function (regParams, errors) {
if (regParams.password.length < 8)
errors.push('Password must be at least 8 characters. ');
return errors;
}
@ekryski
ekryski / gist:1217644
Created September 14, 2011 20:12
Jade Layout error
//Code
app.get('/admin', function(req, res){
res.locals({'title': 'TLF - Admin'});
res.render('admin', {layout: 'Admin/layout'});
});
//Error
SyntaxError: Unexpected identifier
@ekryski
ekryski / index.html
Created November 1, 2012 22:03
Full Bodied Sticky Footer
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Full Bodied Sticky Footer</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<style type="text/css">
@ekryski
ekryski / app.js
Last active December 11, 2015 11:48
Express Error Handler
app.configure( 'development', function () {
app.use( express.logger( {format: 'dev'} ) );
app.use( express.static( __dirname + '/public' ) );
app.use( errorHandler( { dumpExceptions: true, showStack: true } ) );
} );
@ekryski
ekryski / output
Created November 16, 2013 16:00
Error output for `brew install mapnik --verbose`
eric : examples $ brew install mapnik --verbose
==> Downloading http://mapnik.s3.amazonaws.com/dist/v2.2.0/mapnik-v2.2.0.tar.bz2
Already downloaded: /Library/Caches/Homebrew/mapnik-2.2.0.tar.bz2
tar xf /Library/Caches/Homebrew/mapnik-2.2.0.tar.bz2
brew: PYTHONPATH=/usr/local/lib/python2.7/site-packages:/usr/local/Cellar/mapnik/2.2.0/lib/python2.7/site-packages:/usr/local/Cellar/mapnik/2.2.0/libexec/lib/python2.7/site-packages
==> /usr/bin/python scons/scons.py configure CC="clang" CXX="clang++" JOBS=4 PREFIX=/usr/local/Cellar/mapnik/2.2.0 ICU_INCLUDES=/usr/local/opt/icu4c/include ICU_LIBS=/usr/local/opt/icu4c/lib PYTHON_PREFIX=/usr/local/Cellar/mapnik/2.2.0 JPEG_INCLUDES=/usr/local/opt/jpeg/include JPEG_LIBS=/usr/local/opt/jpeg/lib TIFF_INCLUDES=/usr/local/opt/libtiff/include TIFF_LIBS=/usr/local/opt/libtiff/lib BOOST_INCLUDES=/usr/local/opt/boost/include BOOST_LIBS=/usr/local/opt/boost/lib PROJ_INCLUDES=/usr/local/opt/proj/include PROJ_LIBS=/usr/local/opt/proj/lib CAIRO=False
scons: Reading SConscript files
@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.)

@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 / 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 / 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');