Skip to content

Instantly share code, notes, and snippets.

oojikoo-gist

Block or report user

Report or block oojikoo-gist

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View 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',
View video-ruby.rb
# 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 Feb 28, 2016
ios: pod install with rbenv-gemset
View cocoapdo_with_rbenv-gemset.md

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]
View rails_http_status_code_symbol.rb
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',
View rails_routes_cheetsheet.md

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'
View 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")
View rails_models_cheetsheet.md

Rails Models

more advanced

Generating models

$ rails g model User

Associations

@oojikoo-gist
oojikoo-gist / rails_4_binstub_upgrade.md
Last active Jan 19, 2016
rails: rails 4 binstub upgrade
View rails_4_binstub_upgrade.md

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
View rails_rspec_model_example.rb
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 Jan 11, 2016
rails: active admin init
View active_admin.rb
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.
You can’t perform that action at this time.