Skip to content

Instantly share code, notes, and snippets.

@oojikoo-gist
oojikoo-gist / example.webpack.config.js
Created June 22, 2016 09:35
example.webpack.config.js
var path = require('path');
var webpack = require('webpack');
// var fs = require('fs');
var GlobalizePlugin = require('globalize-webpack-plugin');
module.exports = {
name: 'vets4pets',
target: 'web',
version: '0.0.1',
author: 'Chipotle Software (c) 2016',
# Hey Everyone -
# I've been doing some googling here and wanted to ask if anyone's done this before - streamed flash video (*.flv) via Ruby?
# Basically, I'm doing some R&D on a possible future project to use RoR for the site/db access, and Flash to stream video. Thing is, the user needs to be authorized for the video, and it needs to be streamed so it isn't cached on the client-end (for copyright protection purposes - yeah I hate it too, but gotta do it).
# I've seen one tutorial using Ming to do that, but I'd prefer something that has a separate server-side application, and separate client-side application built in Flash, so I have more control over the look and feel of the application, as well as can embed other interesting things in there if I want.
# I've taken a look at Red5 (http://osflash.org/red5), but seeing as it's in Java, I'm not too keen on working with it.
# Part of the reason I want to do this in Ruby is obviously so I can work with it through Rails, -and- so I can use Ruby to fetch videos f
@oojikoo-gist
oojikoo-gist / cocoapdo_with_rbenv-gemset.md
Created February 28, 2016 09:27
ios: pod install with rbenv-gemset

how to pod install with rbenv-gemset on my local

$ initgemset
$ gem install cocoapods --install-dir [.gemsetname-gemsets]/
$ pod init
# after add Podfile
$ pod install [pod-name]
@oojikoo-gist
oojikoo-gist / rails_http_status_code_symbol.rb
Created February 11, 2016 07:36
rails: http status code symbol
HTTP_STATUS_CODES = {
100 => 'Continue',
101 => 'Switching Protocols',
102 => 'Processing',
200 => 'OK',
201 => 'Created',
202 => 'Accepted',
203 => 'Non-Authoritative Information',
204 => 'No Content',
205 => 'Reset Content',
@oojikoo-gist
oojikoo-gist / rails_routes_cheetsheet.md
Created February 3, 2016 03:47
rails: routes cheetsheet

A summary of the Rails Guides on Routes, plus other tips.

The Rails router recognizes URLs and dispatches them to a controller's action. It can also generate paths and URLs, avoiding the need to hardcode strings in your views.

Examples

# Redirects /orders/report to orders#report.
get 'orders/report', to: 'orders#report'
@oojikoo-gist
oojikoo-gist / rails_huston.rb
Created February 1, 2016 06:11
rails: huston.rb
# Houston
# https://github.com/nomad/houston
# Local and Remote Notification Programming Guide - The Feedback Service
# https://goo.gl/vEhEJE
require 'houston'
APN = Houston::Client.development
APN.certificate = File.read("development.pem")
@oojikoo-gist
oojikoo-gist / rails_models_cheetsheet.md
Last active February 4, 2016 22:01
rails: models cheetsheet

Rails Models

more advanced

Generating models

$ rails g model User

Associations

@oojikoo-gist
oojikoo-gist / rails_4_binstub_upgrade.md
Last active January 19, 2016 07:47
rails: rails 4 binstub upgrade

In Rails 4, your app's bin/ directory contains executables that are versioned like any other source code, rather than stubs that are generated on demand.

Here's how to upgrade:

  bundle config --delete bin    # Turn off Bundler's stub generator
  rake rails:update:bin         # Use the new Rails 4 executables
  git add bin                   # Add bin/ to source control
@oojikoo-gist
oojikoo-gist / rails_rspec_model_example.rb
Created January 13, 2016 13:25
rails: rspec model example
context 'check columns exsitence' do
it { is_expected.to respond_to :first_name }
it { is_expected.to respond_to :last_name }
it { is_expected.to respond_to :profilable }
it { is_expected.to respond_to :birth }
it { is_expected.to respond_to :gender }
it { is_expected.to respond_to :bio }
end
context 'model validation and associations' do
@oojikoo-gist
oojikoo-gist / active_admin.rb
Created January 11, 2016 00:28
rails: active admin init
ActiveAdmin.setup do |config|
# == Site Title
#
# Set the title that is displayed on the main layout
# for each of the active admin pages.
#
config.site_title = "Carrierwave Ios Rails Example"
# Set the link url for the title. For example, to take
# users to your main site. Defaults to no link.