Skip to content

Instantly share code, notes, and snippets.

@pvdev
pvdev / vscode_shortcuts.md
Created November 1, 2019 21:03 — forked from bradtraversy/vscode_shortcuts.md
Helpful shortcuts for VSCode

VSCode Shortcuts

List of helpful shortcuts for faster coding

Official List of all commands

Open/View

@pvdev
pvdev / GitHub-Forking.md
Created October 22, 2019 09:13 — forked from Chaser324/GitHub-Forking.md
GitHub Standard Fork & Pull Request Workflow

Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.

In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.

Creating a Fork

Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j

module Devise
module Models
module RemoteAuthenticatable
extend ActiveSupport::Concern
#
# Here you do the request to the external webservice
#
# If the authentication is successful you should return
# a resource instance
module Devise
module Strategies
class RemoteAuthenticatable < Authenticatable
#
# For an example check : https://github.com/plataformatec/devise/blob/master/lib/devise/strategies/database_authenticatable.rb
#
# Method called by warden to authenticate a resource.
#
def authenticate!
#
@pvdev
pvdev / dependency_injection_container.rb
Created November 2, 2012 11:51 — forked from subelsky/dependency_injection_container.rb
Code examples for Ruby Dependencies, Notifications, and Adjustments (Ruby DNA)
require "dim"
AppContainer = Dim::Container.new
AppContainer.register(:env) { ENV['ADWORK_ENV'] || "development" }
AppContainer.register(:production?) { |c| c.env == 'production' }
AppContainer.register(:development?) { |c| c.env == 'development' }
AppContainer.register(:test?) { |c| c.env == 'test' }
AppContainer.register(:root) { File.expand_path(File.dirname(__FILE__)+"/../..") }
AppContainer.register(:logger) do |c|
@pvdev
pvdev / bdd.vim
Created October 3, 2012 15:44
Run RSpec and Cucumber from vim, on the current spec/feature
" Vim functions to run RSpec and Cucumber on the current file and optionally on
" the spec/scenario under the cursor.
function! RailsScriptIfExists(name)
" Bundle exec
if isdirectory(".bundle") || (exists("b:rails_root") && isdirectory(b:rails_root . "/.bundle"))
return "bundle exec " . a:name
" System Binary
else
return a:name
@pvdev
pvdev / adsense_helper.rb
Created September 25, 2012 14:50 — forked from defkode/adsense_helper.rb
Google Adsense Rails 3 helper
module AdsenseHelper
# Author: Tomasz Mazur (defkode@gmail.com)
# http://www.mydigitallife.info/2009/01/17/google-adsense-legacy-old-generation-code-reference-generate-and-get/
# :slot
# :theme
# :background
# :border
# :link
# :text
# rails new my_app_name -J -T -m http://gist.github.com/635287.txt
remove_file 'Gemfile'
create_file 'Gemfile', <<-GEMFILE
source 'http://rubygems.org'
source 'http://gems.github.com'
gem 'rails'
gem 'sqlite3-ruby', :require => 'sqlite3'
gem 'pg', :group => :production
# Application Generator Template
# Devise, Cucumber, RSpec... for use with Rails 3
# http://gist.github.com/513564
# Based on the Mongoid/Devise template: http://github.com/fortuity/rails3-mongoid-devise/raw/master/template.rb
#
#
# Installs my js_lib rakefile, found: http://gist.github.com/raw/628715/js_lib.rake
# (to keep js libraries out of source control.)
#
# Usage: