Skip to content

Instantly share code, notes, and snippets.

🦏
Go go go!

1rhino 1Rhino

🦏
Go go go!
Block or report user

Report or block 1Rhino

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
@1Rhino
1Rhino / web-fonts-asset-pipeline.md
Created May 25, 2018 — forked from anotheruiguy/web-fonts-asset-pipeline.md
Custom Web Fonts and the Rails Asset Pipeline
View web-fonts-asset-pipeline.md

Web fonts are pretty much all the rage. Using a CDN for font libraries, like TypeKit or Google Fonts, will be a great solution for many projects. For others, this is not an option. Especially when you are creating a custom icon library for your project.

Rails and the asset pipeline are great tools, but Rails has yet to get caught up in the custom web font craze.

As with all things Rails, there is more then one way to skin this cat. There is the recommended way, and then there are the other ways.

The recommended way

Here I will show how to update your Rails project so that you can use the asset pipeline appropriately and resource your files using the common Rails convention.

View example_vue.md
  1. UserApi.js
import axios from "axios"

export default {
  getAllExtraCompanies: function (cb, errorCB) {
    let url = '/api/backend/extra_companies'
    this._sendRequestToDelivery(url, {}, 'get', cb, errorCB)
  },
@1Rhino
1Rhino / cloudSettings
Last active Jun 12, 2018
Visual Studio Code Settings Sync Gist
View cloudSettings
{"lastUpload":"2018-06-12T10:12:01.675Z","extensionVersion":"v2.9.2"}
@1Rhino
1Rhino / cloudSettings
Created Mar 21, 2018
Visual Studio Code Settings Sync Gist
View cloudSettings
{"lastUpload":"2018-03-21T16:41:04.629Z","extensionVersion":"v2.9.0"}
@1Rhino
1Rhino / cloudSettings
Created Dec 24, 2017
Visual Studio Code Settings Sync Gist
View cloudSettings
{"lastUpload":"2017-12-24T07:38:53.099Z","extensionVersion":"v2.8.7"}
@1Rhino
1Rhino / cloudSettings
Last active Dec 20, 2017
Visual Studio Code Settings Sync Gist
View cloudSettings
{"lastUpload":"2017-12-20T02:10:36.078Z","extensionVersion":"v2.8.7"}
@1Rhino
1Rhino / cloudSettings
Last active May 15, 2018
Visual Studio Code Settings Sync Gist
View cloudSettings
{"lastUpload":"2018-05-15T08:37:57.340Z","extensionVersion":"v2.9.2"}
View tax.rb
module TaxServices
class ItemPrice
def initialize(total_price, has_tax, has_service_tax)
@total_price = total_price
@service_tax_rate = has_tax ? Settings.tax.service_tax_rate : 0
@tax_rate = has_service_tax ? Settings.tax.tax_rate : 0
end
def perform
OpenStruct(
@1Rhino
1Rhino / deploy.rb
Created Apr 10, 2017 — forked from stas/deploy.rb
Mina Deploy Task (Rails + Puma + Delay Job + rbenv)
View deploy.rb
require 'mina/bundler'
require 'mina/rails'
require 'mina/git'
require 'mina/rbenv' # for rbenv support. (http://rbenv.org)
# require 'mina/rvm' # for rvm support. (http://rvm.io)
# Basic settings:
# domain - The hostname to SSH to.
# deploy_to - Path to deploy into.
# repository - Git repo to clone from. (needed by mina/git)
@1Rhino
1Rhino / gist:82d112edacef7f0630693675c551bdbc
Created Mar 16, 2017 — forked from jgorset/gist:1747655
How Sprockets works with JST and EJS templates
View gist:82d112edacef7f0630693675c551bdbc
// This document distills the magic that happens when you create a file with the ".jst"
// and ".ejs" extensions anywhere on your asset path in Ruby on Rails, courtesy of the
// Sprockets library (https://github.com/sstephenson/sprockets).
//
// For the purpose of this example, imagine that you have created a template for
// messages in `app/assets/javascripts/backbone/templates/messages/message.jst.ejs`
// with the following contents:
//
// <h1><%= user.full_name %></h1>
// <p><%= body %></p>
You can’t perform that action at this time.