This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!-- | |
Author: Travis Haynes <[email protected]> | |
Syntax highlighting for Yahoo! RTML | |
--> | |
<language id="rtml" _name="RTML" version="2.0" _section="Markup"> | |
<metadata> | |
<property name="mimetypes">x-rtml</property> | |
<property name="globs">*.rtml</property> | |
<property name="block-comment-start"><!--</property> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fs = require 'fs' | |
{exec} = require 'child_process' | |
util = require 'util' | |
projectName = "PROJECT_NAME" # TODO: change to your project's name | |
appFiles = [ | |
# TODO: add your project's source files in the order they should be concatenated | |
"src/#{projectName}.coffee" | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'sqlite3' | |
require 'active_record' | |
require 'slim' | |
ActiveRecord::Base.establish_connection( | |
:adapter => "sqlite3", | |
:database => ":memory:" | |
) | |
class CreateBlogsTable < ActiveRecord::Migration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'sqlite3' | |
require 'active_record' | |
require 'slim' | |
ActiveRecord::Base.establish_connection( | |
:adapter => "sqlite3", | |
:database => ":memory:" | |
) | |
class CreateBlogsTable < ActiveRecord::Migration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module GoogleFontsHelper | |
# generates a link tag for Google fonts | |
# @param [Hash] fonts contains the font families and weights | |
# @return [String] The generated link tag | |
# @example Droid+Sans in weights 400 and 700, and Yanone+Kaffeesatz in 300 and 400 | |
# = google_fonts_link_tag :droid_sans => [400, 700], :yanone_kaffeesatz => [300, 400] | |
def google_fonts_link_tag(fonts = {}) | |
family = fonts.inject([]) do |result, (font, sizes)| | |
# convert font into a String | |
font = font.to_s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var goal = 10000.00, // without a goal it will return the total purchase amount after the school percentage is applied | |
shop_id = 1195332, // this can be found in the top-right corner of the metafields app when logged into a shop | |
server = "http://localhost:3000"; // set this to the location of the metafields app | |
// get the shop's percentage using a JSONP AJAX call | |
// Note: This must use JSONP to avoid raising a cross domain access error | |
$.ajax({ | |
url : server + "/progress/" + shop_id + ".json", | |
type : "get", | |
data : "goal=" + goal, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SessionsController < ApplicationController | |
skip_authorization_check | |
def new | |
unless params[:shop].present? | |
@shop = Shop.new | |
return | |
end | |
@session = ShopifyAPI::Session.new(params[:shop], params[:t], params) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource :shopify_session, only: [:new, :create, :destroy] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.Shopify = new EasyXDM.Rpc({ | |
remote: "http://domain.myshopify.com/cart" | |
}, { | |
remote: { | |
getCart: {} | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem 'shopify_api' | |
gem 'omniauth-shopify-oauth2' | |
gem 'slim-rails' |
OlderNewer