Skip to content

Instantly share code, notes, and snippets.

View ravishrivastava's full-sized avatar

Ravi Shrivastava ravishrivastava

View GitHub Profile
@ravishrivastava
ravishrivastava / mysql.database.yml
Created September 22, 2018 07:21 — forked from mmizutani/mysql.database.yml
Sample config/database.yml from Rails. Postgres, MySQL, and SQLite
#
# Install the MYSQL driver
# gem install mysql2
#
# Ensure the MySQL gem is defined in your Gemfile
# gem 'mysql2'
#
# And be sure to use new-style password hashing:
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
development:
'use strict';
var numberReducer = function numberReducer(state, action) {
if (state === undefined) state = 0;
switch (action.type) {
case 'INCREMENT':
return state + 1;
case 'DECREMENT':
return state - 1;
Go to file > preference > keyboard shortcut and add following for copy line up/dowm
[
{ "key": "shift+alt+down", "command": "editor.action.copyLinesDownAction",
"when": "editorTextFocus" },
{ "key": "shift+alt+up", "command": "editor.action.copyLinesUpAction",
"when": "editorTextFocus" },
]

1. Clone your fork:

git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
http://www.lelylan.com/
https://github.com/SciRuby/daru
https://gist.github.com/lucashungaro/524462
http://www.betterspecs.org/
https://www.hackster.io/thingsquare/build-a-wireless-street-lighting-system-f105c3
http://www.butunclebob.com/
https://kipalog.com
https://kipalog.com/posts/Toi-da-dung-Docker-nhu-the-nao
$LocalTempDir = $env:TEMP; $ChromeInstaller = "ChromeInstaller.exe"; (new-object System.Net.WebClient).DownloadFile('http://dl.google.com/chrome/install/375.126/chrome_installer.exe', "$LocalTempDir\$ChromeInstaller"); & "$LocalTempDir\$ChromeInstaller" /silent /install; $Process2Monitor = "ChromeInstaller"; Do { $ProcessesFound = Get-Process | ?{$Process2Monitor -contains $_.Name} | Select-Object -ExpandProperty Name; If ($ProcessesFound) { "Still running: $($ProcessesFound -join ', ')" | Write-Host; Start-Sleep -Seconds 2 } else { rm "$LocalTempDir\$ChromeInstaller" -ErrorAction SilentlyContinue -Verbose } } Until (!$ProcessesFound)
#!/bin/bash
# Check commit for debugger, binding.pry or byebug
if test "$(git diff --cached | grep '\+.*debugger')"
then
echo "Error: Attempt to commit a debugger line"
echo "To skip this check, add the --no-verify option"
exit 1
fi
@ravishrivastava
ravishrivastava / application_controller.rb
Created August 10, 2017 07:58 — forked from seangaffney/application_controller.rb
Setting mailer path in Rails 3
class ApplicationController < ActionController::Base
protect_from_forgery
before_filter :mailer_set_url_options
def mailer_set_url_options
ActionMailer::Base.default_url_options[:host] = request.host_with_port
end
end
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.1.1'
# Use sqlite3 as the database for Active Record
gem 'mysql2'
# gem 'sqlite3'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.3'