Skip to content

Instantly share code, notes, and snippets.

@jurikern
jurikern / gist:3973497
Created October 29, 2012 13:18
ActionController::Metal#session delegated to @_request.session, but @_request is nil
2012-10-29T13:15:49Z 4284 TID-oxp71xhu0 XmlFeedWorker MSG-oxp7irbuk INFO: start
2012-10-29T13:15:56Z 4284 TID-oxp71xhu0 XmlFeedWorker MSG-oxp7irbuk INFO: fail: 6.626 sec
2012-10-29T13:15:56Z 4284 TID-oxp71xhu0 WARN: {"retry"=>true, "queue"=>"default", "class"=>"XmlFeedWorker", "args"=>[], "error_message"=>"ActionController::Metal#session delegated to @_request.session, but @_request is nil: #<TemplatesController:0x007ff61b9f3788 @_routes=nil, @_action_has_layout=true, @_headers={\"Content-Type\"=>\"text/html\"}, @_status=200, @_request=nil, @_response=nil, @_prefixes=[\"templates\", \"application\"], @_config={}, @_lookup_context=#<ActionView::LookupContext:0x007ff6202a3730 @details_key=#<ActionView::LookupContext::DetailsKey:0x007ff61cb66e70 @hash=-3365680752233435110>, @details={:locale=>[:en], :formats=>[:html], :handlers=>[:erb, :builder, :coffee, :haml, :slim]}, @skip_default_locale=false, @cache=true, @prefixes=[\"templates\", \"application\"], @rendered_format=:html, @view_paths=#<ActionView::PathSet:0
@jurikern
jurikern / gist:4473824
Last active December 10, 2015 18:18
How update rbenv(ruby-build) with ruby versions list on MAC OS X.
before:
command: rbenv install 1.9.3-p362
output: ruby-build: definition not found: 1.9.3-p362
hack:
command: brew unlink ruby-build
output: Unlinking /usr/local/Cellar/ruby-build/20121120... 4 links removed
command: brew update
@jurikern
jurikern / gist:4524835
Created January 13, 2013 16:06
Compiling Objective-C Files an Linux (Ubuntu)
Before:
sudo apt-get -y install gnustep
sudo apt-get -y install gnustep-devel
sudo apt-get -y install build-essential
sudo apt-get -y install gobjc
sudo apt-get -y install gnustep-make
sudo apt-get -y install libgnustep-base-dev
Compiling for one source file (For example main.m):
gcc `gnustep-config --objc-flags` main.m -o hello -I /usr/include/GNUstep/ -L /usr/lib/GNUstep/ -lgnustep-base
@jurikern
jurikern / gist:5191521
Created March 18, 2013 22:41
Login with binded backbone
class Application.Views.Users.Login
@bindedWith: (selector) ->
$(selector).each ->
Application.Views.Users.Login($(@))
constructor: (@container) ->
_.extend(@, Backbone.Events)
@initForm()
initForm: =>
@jurikern
jurikern / gist:5199636
Last active December 15, 2015 04:09
Binded Backbone v2
class Application.Views.Base
@bindWith: (selector) ->
instance = @
$(selector).each ->
new instance($(@))
constructor: (@container) ->
_.extend(@, Backbone.Events)
@jurikern
jurikern / gist:5219692
Created March 22, 2013 08:10
MacOS X wxPython installer issue
sudo installer -pkg wxPython2.8-osx-unicode-universal-py2.7.pkg -target /
installer: Package name is wxPython2.8-osx-unicode-universal-py2.7
installer: Installing at base path /
2013-03-22 10:09:12.634 installer[8633:5a03] Package /Users/semjonow/Desktop/wxPython2.8-osx-unicode-universal-py2.7.pkg uses a deprecated pre-10.2 format (or uses a newer format but is invalid).
installer: The install was successful.
@jurikern
jurikern / gist:5531825
Created May 7, 2013 10:58
Image Crop from Canvas
detectCanvas: =>
if @canvas
@canvas.replaceWith("<canvas class='picture_canvas' data-block='canvas'></canvas>")
@canvas = @container.find("*[data-block='canvas']")
@ctx = @canvas.get(0).getContext("2d")
handleImage: (e) =>
@detectCanvas()
@jurikern
jurikern / gist:7154025
Created October 25, 2013 12:37
pg_hba no user no password example
# Database administrative login by Unix domain socket
local all postgres trust
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all all 127.0.0.1/32 trust
# IPv6 local connections:
@jurikern
jurikern / rebase-tools
Last active August 29, 2015 13:55
Git rebase-tools
git rebase
git rebase --abort
git rebase --continue
git rebase --skip
git push origin feature --force
git pull --rebase origin feature
git merge fature --no-ff
@jurikern
jurikern / chee_api
Created May 5, 2014 11:06
chee_request_example
curl -X POST -H "Content-Type: application/json" -d \
'{"deals":[{"id":"1023410623", "quantity":"3"}, {"id":"1023410633", "choices":"1023413223"}], \
"delivery": "smartpost", "delivery_info": { "smartpost": {"deliveryLocationID": "133"}}, \
"user": {"email": "[email protected]", "username": "Juri Semjonov", "phone": "55687059"}, \
"purchase": {}}' \
http://localhost:3000/api/v1/api_key/api_secret/purchases
===
{"success":true,"message":"Purchase successfully saved","url":"/en/cart/completed?hash=52b0acfb7bbd10c44f575f0db121fdd2&id=150995149","errors":[]}