Kuba Kuźma qoobaa

View gist:10368474
1 2 3 4 5 6 7 8 9 10
this.resource("restaurants", function () {
this.resource("restaurant", { path: "/:restaurant_id" }, function () {
this.route("show", { path: "/" });
this.resource("bookings", function () {
this.route("new");
this.resource("booking", { path: "/:booking_id" }, function () {
this.route("show");
});
});
});
View gist:10107191
1 2 3 4 5 6 7 8 9
class User < ActiveRecord::Base
ROLES = %w[admin manager client]
 
validates :role, inclusion: {in: ROLES}
 
def role
ActiveSupport::StringInquirer.new(self[:role].to_s)
end
end
View gist:10106882
1 2 3 4 5 6 7 8 9 10
class V1::Client::SessionsController < V1::Client::ApplicationController
skip_before_action :authenticate, only: %i[create]
 
def create
@session = ::Client::Session.new(session_params)
@session.save
respond_with @session, location: nil
end
 
private
View NBP.sql
1 2 3 4 5 6 7
USE "https://raw.github.com/cowbell/yql-tables/master/nbp/nbp.dir.xml";
USE "https://raw.github.com/cowbell/yql-tables/master/nbp/nbp.tables.xml";
 
SELECT * FROM nbp.tables WHERE id IN
(SELECT id FROM nbp.dir WHERE typ = 'A' AND data_publikacji < '2014-03-01'
| SORT(field='data_publikacji')
| TAIL(count=1));
View gist:9099599
1 2 3 4 5 6 7 8 9 10
module TestUser
class User < SimpleDelegator
include Rails.application.routes.url_helpers
include FactoryGirl::Syntax::Methods
 
Capybara::Session::DSL_METHODS.each do |method|
define_method method do |*args, &block|
@session.send method, *args, &block
end
end
View npm -g ls
1 2 3 4 5 6 7 8 9 10
/usr/lib
└─┬ npm@1.3.21
├── abbrev@1.0.4
├── ansi@0.2.1
├── ansicolors@0.3.2
├── ansistyles@0.1.3
├── archy@0.0.2
├── block-stream@0.0.7
├── child-process-close@0.1.1
├── chmodr@0.1.0
View npm ls
1 2 3 4 5 6 7 8 9 10
sar@0.1.1 /home/kuba/Projects/sarkmsjs
├─┬ bower@1.2.8
│ ├── abbrev@1.0.4
│ ├── archy@0.0.2
│ ├─┬ bower-config@0.5.0
│ │ ├── mout@0.6.0
│ │ └─┬ optimist@0.6.0
│ │ ├── minimist@0.0.5
│ │ └── wordwrap@0.0.2
│ ├── bower-endpoint-parser@0.2.1
View numbers.js
1 2 3 4 5 6 7 8 9 10
var count = 2,
people = [{
name: "Joe",
age: 44,
updatedAt: 1382351154540
},
{
name: "Alice",
age: 37,
updatedAt: 1382351205213
View gist:7009967
1
data:text/csv;base64,MSxhbGEsbWEsa290YQ==
View reload.rb
1 2 3 4 5
if request.path == "/reload"
self.class.load_settings!
RailsMultisite::ConnectionManagement.each_connection { SiteSetting.refresh! }
return [200, {}, ["success"]]
end
Something went wrong with that request. Please try again.