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
| location /faye { | |
| proxy_set_header X-Real-IP $remote_addr; | |
| proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
| proxy_set_header Host $http_host; | |
| proxy_redirect off; | |
| proxy_set_header Upgrade $http_upgrade; | |
| proxy_set_header Connection "upgrade"; | |
| proxy_http_version 1.1; |
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
| angular.module("app").directive 'box', ($compile) -> | |
| restrict: 'AE' | |
| scope: {} | |
| compile: (elem, attrs) -> | |
| template = elem.html() | |
| (scope, elem, attrs, controller) -> | |
| elem.empty() | |
| elem.append($compile(template)(scope)) |
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
| # based on http://api.rubyonrails.org/classes/ActionController/RequestForgeryProtection.html | |
| module Auth | |
| extend ActiveSupport::Concern | |
| included do | |
| helpers do | |
| def session | |
| env['rack.session'] | |
| 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
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
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
| angular.module('app').controller 'UserCtrl', ($scope, User) -> | |
| $scope.save(user) -> | |
| $scope.errors = {} | |
| success = -> | |
| # do something | |
| error = -> | |
| angular.forEach result.data.errors, (errors, field) -> | |
| $scope.form[field].$setValidity('server', false) | |
| $scope.errors[field] = errors.join(', ') # e.g. username is already taken |
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
| Api = ($http) -> | |
| { | |
| games: { | |
| query: -> | |
| $http.get('/games', params: {format: 'json'}) | |
| } | |
| } | |
| angular.module('got').factory('Api', ['$http', Api]) |
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 Example; def inspect; raise "whatever"; end; end; | |
| Example.new | |
| RuntimeError: whatever | |
| from (irb):1:in `inspect' | |
| from /home/yanoo/.rbenv/versions/1.9.3-p194/bin/irb:12:in `<main>' |
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
| Response.new(self, last_response, lambda{}, {body: ""}) | |
| => nil | |
| Response.new(self, last_response, lambda{}, {body: ""}).nil? | |
| => true | |
| Response.new(self, last_response, lambda{}, {body: ""}).class | |
| => HTTParty::Response | |
| Response.new(self, last_response, lambda{}, {body: ""}) == nil | |
| => false | |
| Response.new(self, last_response, lambda{}, {body: ""}) === nil | |
| => true |
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
| -# taka pierda, że aż funkcje jakąś trzeba wywołać /facepalm | |
| = surround '(', ')' do | |
| = value | |
| -# ja pierdole, jak to ssie | |
| = "(#{value})" | |
| -# nawet nie wiem czy to zadziała, bo się pewnie na parsowaniu wyjebie |
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
| Installing therubyracer (0.11.1) with native extensions | |
| Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. | |
| /home/ubuntu/.rvm/rubies/ruby-1.9.3-p327/bin/ruby extconf.rb | |
| checking for main() in -lpthread... yes | |
| creating Makefile | |
| make | |
| compiling script.cc | |
| compiling handles.cc |