Skip to content

Instantly share code, notes, and snippets.

View datt's full-sized avatar
🏠
Working from home

Dattatraya Dongare datt

🏠
Working from home
View GitHub Profile

Prefix all commands with Ctrl-b

Command                                 Action

c	                      Create a new window
n	                      Change to next window
p	                      Change to previous window
"	                      Split pane horizontally
%	                      Split pane vertically
,	                      Rename current window
o	                      Move to next pane
Start and stop the server on Windows
Start and stop the server on Linux
Start and stop Apache
Start and stop the server on Windows
Start the server from the Start menu
Choose Start > All Programs > Adobe > Flash Media Server 4.5 > Start Adobe Flash Media Server 4.5.
Choose Start > All Programs > Adobe > Flash Media Server 4.5 > Start Flash Media Administration Server 4.5.
Stop the server from the Start menu
# PassengerMaxPoolSize
# Default: 6
# For 2gb RAM: 30
# For 256 slice with MySQL running: 2
PassengerMaxPoolSize 2
# PassengerPoolIdleTime
# Recommended to be avg time per page * 2
# In Google Analytics... (Avg time on site / Avg page views) * 2
# Default: 300
@datt
datt / httpd.conf
Last active December 17, 2015 09:49
1] Configuring apache2 for listening to ports other than 80. 2] Configuring apache2 for sinatra app.
Listen 3333
<VirtualHost *:80 *:3333>
ServerName local.mlb.com
railsEnv development
# !!! Be sure to point DocumentRoot to 'public'!
DocumentRoot /home/mahavir/projects/rails_projects/mlb_repo/mlb/public
<Directory /home/mahavir/projects/rails_projects/mlb_repo/mlb/public>
# This relaxes Apache security settings.
AllowOverride all
# MultiViews must be turned off.
<virtualhost *:80>
ServerName app.com
ServerAlias www.app.com
DocumentRoot /var/www/html/blog/public # <-- be sure to point to 'public'!
setenv RAILS_ENV production
<Directory /var/www/html/blog/public>
AllowOverride All
RailsEnv production
</Directory
ErrorLog /var/log/apache2/blog_error_log
#Getting email unscrewed
#First configure Devise email in config/initializers/devise.rb:
config.mailer_sender = "vivek@yopmail.com"
#If you continue to get an error message, did you reboot the server?
#Localhost email testing
#Do this in the shell you’re using to run the Rails server:
#$ export GMAIL_SMTP_USER=username@gmail.com
@datt
datt / mrdi.md
Created May 16, 2013 09:10 — forked from vparihar01/mrdi.md

Models, Roles, Decorators, and Interactions

A modest alternative to DCI that might be worth further thought

One of the problems with advancing the discussion on DCI is that we lack a comparable alternative pattern that has the same goals, but favors a low ceremony approach. The closest thing we have to that is Rails concerns, but they are more like distant relatives of the DCI concepts rather than first cousins, and that makes comparisions between the two approaches not especially fruitful.

I am considering the idea of experimenting with my own paradigm that captures the intent and purity of DCI, but with the convenience of concerns. Please note that this is just the starting point of a conversation, it is NOT a promise of comercially available cold fusion or a cure for cancer. It's just a gist with an idea on it I'd like to hear your thoughts on.

What if we had a top-level topology that was split into Models, **Rol

# change past commit's author email from 'vishal@blah.\(none\)' to 'the@vishaltelangre.com'
git filter-branch --env-filter 'if [ $GIT_AUTHOR_EMAIL = vishal@blah.\(none\) ]; then GIT_AUTHOR_EMAIL=the@vishaltelangre.com; fi; export GIT_AUTHOR_EMAIL'
# change past commit's author name from 'vishal' to 'Vishal Telangre'
git filter-branch --env-filter 'if [ $GIT_AUTHOR_NAME = vishal ]; then GIT_AUTHOR_EMAIL=Vishal\ Telangre; fi; export GIT_AUTHOR_NAME'
// check flash support for visitor browser
function isFlashSupported() {
var hasFlash = false;
try {
var fo = new ActiveXObject('ShockwaveFlash.ShockwaveFlash');
if(fo) hasFlash = true;
}catch(e){
if(navigator.mimeTypes ["application/x-shockwave-flash"] != undefined) {
hasFlash = true;
}
mysqldump --user=XXXXXXXX --password=XXXXXXX -A > /PATH/TO/DUMPFILE.SQL
mysql --verbose --user=XXXXXXXX --password=XXXXXXXX DB_NAME < /PATH/TO/DUMPFILE.SQL