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
angular.module("testApp", []) | |
.controller("testController", function ($scope) { | |
$scope.base = 1; | |
$scope.currency = "USD"; | |
$scope.multiplyByBase = function(amount) { | |
var base = parseFloat($scope.base) ? $scope.base : 1; | |
return amount * base; | |
} |
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
alert() |
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
function* () { | |
var user = yield User.find(10); | |
var posts = yield Posts.where({ user_id: user.id }); | |
console.log(user, posts); | |
}; |
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
FROM ruby:2.2.0 | |
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev | |
RUN mkdir /signupsumo | |
WORKDIR /signupsumo | |
ADD Gemfile /signupsumo/Gemfile | |
ADD Gemfile.lock /signupsumo/Gemfile.lock | |
RUN bundle install | |
ADD . /signupsumo |
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
SELECT | |
employee.name | |
FROM | |
`Employees` employee, | |
`Employees` boss | |
WHERE | |
employee.boss_id = boss.id | |
AND | |
employee.salary > boss.salary; |
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 'perseus' | |
class TeamRankedStatJob < ActiveJob::Base | |
attr_reader :team | |
queue_as :default | |
def perform(team) #rename team here | |
@team = team | |
## Get ready | |
client = Perseus::Client.new(Settings.rito.api_key, region: team.server) |
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 Team < ActiveRecord::Base | |
# Friendly ID | |
extend FriendlyId | |
friendly_id :name | |
# Rolify | |
resourcify | |
# Associations | |
belongs_to :user |
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
describe "Articles" do | |
it "creates a new article" do | |
article = create(:article) | |
visit new_article_path | |
fill_in "Name", :with => article.name | |
fill_in "Content", :with => article.content | |
click_button "Create Article" | |
page.should have_content("Article was successfully created.") | |
end | |
end |
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
#!/usr/bin/env bash | |
sudo apt-get -y update | |
sudo apt-get -y install build-essential zlib1g-dev libssl-dev libreadline-gplv2-dev libyaml-dev | |
cd /tmp | |
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p125.tar.gz | |
tar -xvzf ruby-1.9.3-p125.tar.gz | |
cd ruby-1.9.3-p125/ | |
./configure --prefix=/usr/local | |
make | |
make install |
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
#!/usr/bin/env bash | |
yum -y update | |
yum -y install httpd | |
yum -y install php | |
yum -y install mysql | |
yum -y install mysql-server | |
yum -y install php-mysql | |
#Turn on services on restart | |
/sbin/chkconfig httpd on |
OlderNewer