This file contains hidden or 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
| add_search_scope :by_stock_location do | |
| order(%q{ | |
| ( | |
| SELECT | |
| CASE | |
| WHEN tt.count_on_hand > 0 | |
| THEN 2 | |
| WHEN zz.backorderable = true | |
| THEN 1 | |
| ELSE 0 |
This file contains hidden or 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 "bundler/capistrano" | |
| server "server", :web, :app, :db, primary: true | |
| set :application, "<application>" | |
| set :user, "<user>" | |
| set :group, "wheel" | |
| set :deploy_to, "/home/#{user}/apps/#{application}" | |
| set :deploy_via, :remote_cache | |
| set :use_sudo, false |
This file contains hidden or 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
| VERSION=2.6.7 | |
| apt-get -y install wget | |
| rm -rf redis-$VERSION | |
| wget http://redis.googlecode.com/files/redis-$VERSION.tar.gz -O redis-$VERSION.tar.gz | |
| tar -xzvf redis-$VERSION.tar.gz | |
| cd redis-$VERSION | |
| ./configure --prefix=/usr | |
| make | |
| rm -rf /tmp/redis-$VERSION.$$ | |
| mkdir /tmp/redis-$VERSION.$$ |
This file contains hidden or 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 assert = require('assert'), | |
| vows = require('vows'), | |
| resourceful = require('../lib/resourceful'); | |
| vows.describe('resourceful/hooks/sync').addBatch({ | |
| "a Resource (update)": { | |
| topic: function () { | |
| return resourceful.define('ResourceUpdate', function () { | |
| this.property('name'); | |
| this.property('full'); |
This file contains hidden or 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 OmniAuth | |
| module Strategies | |
| class Steam < OmniAuth::Strategies::OpenID | |
| include OmniAuth::Strategy | |
| args [:store, :api_key] | |
| option :options, {} | |
| option :identifier, "http://steamcommunity.com/openid" | |
| option :name, :steam | |
This file contains hidden or 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 CreatePeople < ActiveRecord::Migration | |
| def change | |
| create_table :people do |t| | |
| t.string :name | |
| t.timestamps | |
| end | |
| end | |
| end |
This file contains hidden or 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 items = ["facebook", "github", "twitter", "instagram"] | |
| - if (!everyauth.loggedIn) | |
| h2 Not Authenticated | |
| each item in items | |
| a(href='/auth/' + item) | |
| span Connect with <span style="text-transform: capitalize">!{item}</span><br /> | |
| - else | |
| h2 Authenticated | |
| #user-id Logged in with `user.id` #{user.id} - aka `everyauth.user.id` #{everyauth.user.id} |
This file contains hidden or 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 'rspec' | |
| require 'nokogiri' | |
| require 'open-uri' | |
| describe "nokogiri steam failure" do | |
| it "should only see a url once since they don't repeat" do | |
| doc = Nokogiri::HTML(open(URI.encode("http://store.steampowered.com/search/results?sort_by=Name&sort_order=ASC&category1=998&cc=us&v6=1&page=1"))) | |
| @kickthebaby = doc.search('//a[@href="http://store.steampowered.com/app/15540/?snr=1_7_7_230_150_1"]').size |
This file contains hidden or 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
| <?php | |
| require_once(TOOLKIT . '/class.event.php'); | |
| Class eventgenerate_a_calendar extends Event { | |
| const ROOTELEMENT = 'generate-a-calendar'; | |
| public $eParamFILTERS = array(); | |
| public static function about() { | |
| return array( | |
| 'name' => 'Generate a Calendar', | |
| 'author' => array( |
This file contains hidden or 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"?> | |
| <xsl:stylesheet version="1.0" | |
| xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | |
| xmlns:date="http://exslt.org/dates-and-times" | |
| extension-element-prefixes="date"> | |
| <xsl:import href="get-schedule.xsl" /> | |
| <!-- | |
| Name: XSLT Calendar |