Skip to content

Instantly share code, notes, and snippets.

View ValeriiVasin's full-sized avatar
🇺🇦

Valerii Vasin ValeriiVasin

🇺🇦
View GitHub Profile
@ValeriiVasin
ValeriiVasin / gist:3486197
Created August 27, 2012 06:21
SublimeLinter user settings
{
// http://www.jshint.com/docs/
"jshint_options": {
// prohibits the use of explicitly undeclared variables
"undef": true,
// prohibits the use of a variable before it was defined
"latedef": true,
@ValeriiVasin
ValeriiVasin / pubsub.md
Created February 26, 2012 23:11 — forked from addyosmani/pubsub.md
Four ways to do Pub/Sub with jQuery 1.7 and jQuery UI (in the future)

#Four Ways To Do Pub/Sub With jQuery 1.7 and jQuery UI (in the future)

Between jQuery 1.7 and some of work going into future versions of jQuery UI, there are a ton of hot new ways for you to get your publish/subscribe on. Here are just four of them, three of which are new.

(PS: If you're unfamiliar with pub/sub, read the guide to it that Julian Aubourg and I wrote here http://msdn.microsoft.com/en-us/scriptjunkie/hh201955.aspx)

##Option 1: Using jQuery 1.7's $.Callbacks() feature:

$.Callbacks are a multi-purpose callbacks list object which can be used as a base layer to build new functionality including simple publish/subscribe systems. We haven't yet released the API documentation for this feature just yet, but for more information on it (including lots of examples), see my post on $.Callbacks() here:

@ValeriiVasin
ValeriiVasin / application.rb
Created January 14, 2012 17:35 — forked from aslam/application.rb
Rails 3 reset session using devise (actually not using devise)
class ApplicationController < ActionController::Base
...
before_filter :save_or_clear_session
def save_or_clear_session
if controller_name.eql?('sessions') and action_name.eql?('destroy')
request.reset_session
flash[:notice] = "Signed out successfully."
end
end
@ValeriiVasin
ValeriiVasin / gist:1378015
Created November 18, 2011 22:49 — forked from oleksiilevzhynskyi/gist:1207023
ppa for sublime-text-2
sudo add-apt-repository ppa:webupd8team/sublime-text-2
sudo apt-get update
sudo apt-get install sublime-text-2