$ rails g model User
belongs_to
has_one
gem 'kaminari' | |
gem 'ransack' |
I took down this Gist due to concerns about the security of the encryption/decryption part of this code (see comments below).
Rob Napier (@rnapier) has created a publicly available class that provides similar AES encryption/decryption functionality at https://github.com/rnapier/RNCryptor.
# Extracted from https://github.com/se3000/ruby-eth | |
# | |
# Dependencies: | |
# - gem 'digest-sha3' | |
# - gem 'rlp' | |
# | |
# Usage: | |
# - Eth::Utils.valid_address?('0x4Db7569F90bd836294B11c8b08B853d2de499Ced') | |
# => true | |
# - Eth::Utils.format_address('0x4db7569f90bd836294b11c8b08b853d2de499ced') |
#!/bin/sh | |
PROJECT="" # Fill this in | |
IMAGES="$PROJECT/app/assets/images" | |
VIEWS="$PROJECT/app/views" | |
CSS="$PROJECT/app/assets/stylesheets" | |
for image in `find $IMAGES -type f` | |
do | |
name=`basename $image` |
CensusReporter = { | |
GeoIDLayer: L.GeoJSON.extend({ | |
addGeoID: function(geoid) { | |
var request = new XMLHttpRequest(); | |
var url = this.options.api_url + "/1.0/geo/show/tiger2013?geo_ids=" + geoid; | |
request.open('GET', url, true); | |
var self = this; | |
request.onreadystatechange = function() { | |
if (this.readyState === 4) { | |
if (this.status >= 200 && this.status < 400) { |
# config/initializers/active_admin.rb | |
ActiveAdmin.setup do |config| | |
config.current_user_method = :current_user | |
config.authentication_method = :authenticate_user! | |
config.before_filter :admin_role_filter | |
end | |
# Adding all recource names to Permissions table after ActiveAdmin is loaded |
SingletonClass.h: | |
@interface SingletonClass : NSObject | |
@property (nonatomic, retain) NSString *myProperty; | |
+ (SingletonClass *)sharedInstance; | |
@end | |
SingletonClass.m: | |
@implentation | |
+ (SingletonClass *)sharedInstance |