Skip to content

Instantly share code, notes, and snippets.

View Genkilabs's full-sized avatar
😸
Writing software...

Alex Genkilabs

😸
Writing software...
  • Adept Mobile
  • Colorado
View GitHub Profile
@Genkilabs
Genkilabs / to_bool.rb
Created November 23, 2015 20:31
Add a 'to_bool' method to every Ruby / Rails class with initializer
#Alias the default boolean? operator of ruby for everything so all objects responds_to? :to_bool
#...then further refine it for specific classes later
class Object
def to_bool
return !!self
end
end
#Lets give String a custom to_bool that is in line with the meaning for our specific program
class String
@Genkilabs
Genkilabs / build.sh
Last active August 29, 2015 14:07
Localhost developing in Coalesce for Ember CLI based apps
#!/bin/bash
cd ../../coalesce;
npm run-script build;
cd ../coalesce-ember;
# Hack to use the latest version of Coalesce
cp ../coalesce/dist/* bower_components/coalesce/
npm run-script build;
cd ../ember-cli-coalesce-todos/client;
mkdir -p vendor/coalesce-ember
@Genkilabs
Genkilabs / simple-auth-config.js
Created August 25, 2014 20:29
ember-cli-simple-auth-devise initializer for setting endpoint. Lets you run on Rails localhost without proxy.
// app/initializers/simple-auth-config.js
export default {
name: 'simple-auth-config',
before: 'simple-auth',
initialize: function() {
var tokenEndpoint = '/users/sign_in';
MyAppnameENV['simple-auth'] = {
authorizer: 'simple-auth-authorizer:devise',
crossOriginWhitelist:[