Skip to content

Instantly share code, notes, and snippets.

View shreyasmm's full-sized avatar

Shreyas MM shreyasmm

View GitHub Profile
@shreyasmm
shreyasmm / lamp handy cmds
Last active August 29, 2015 13:56
Install Lamp
First update system packages and repositeries
sudo apt-get update && sudo apt-get upgrade
you can install LAMP in one Command
sudo apt-get install lamp-server^
Install Apache
sudo apt-get install apache2 libapache2-mod-php5
Install MySQL
@shreyasmm
shreyasmm / wp-config tweaks
Last active May 24, 2022 17:46
wp-config.php Tweaks
Basics
define('DB_NAME', 'database-name');
define('DB_USER', 'database-username');
define('DB_PASSWORD', 'database-password');
define('DB_HOST', 'localhost');
You can even specify an alternate port for your database server. Here are two examples:
define('DB_HOST', 'localhost:1234');
define('DB_HOST', 'mysql.domain.tld:1234');
@shreyasmm
shreyasmm / mediaqueries
Last active August 29, 2015 14:02
CSS Media Queries
/* Smartphones (portrait and landscape) ----------- */
@media only screen
and (min-device-width : 320px)
and (max-device-width : 480px) {
/* STYLES GO HERE */
}
/* Smartphones (landscape) ----------- */
@media only screen
and (min-width : 321px) {
@shreyasmm
shreyasmm / nginx_ubuntu
Last active August 29, 2015 14:02 — forked from abenrob/nginx_node_postgis.md
install Nginx on Ubuntu
NGINX on Ubuntu 14.04 Trusty
Download signing key from Nginx.org:
```
wget http://nginx.org/keys/nginx_signing.key
```
Apply the key to your apt repos:
```
sudo apt-key add nginx_signing.key
@shreyasmm
shreyasmm / nodejs_ubuntu
Created June 19, 2014 15:35
Install Nodejs on Ubuntu
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs
This is all you need to do. npm is bundled with node.js and will be installed automatically if you install this way.
If you want to make sure you’ve got the very most recent release of npm, you can do:
sudo npm install npm -g
@shreyasmm
shreyasmm / oh-my-zsh_ubuntu
Created June 20, 2014 05:15
install oh-my-zsh in ubuntu
I am not terminal fanatic. But i like working on it. On linux i use my default terminal app with a shell framework named “Oh My ZSH”. Its a bautifull framework with lots of useful staffs. In this post i will tell you, how to install Oh my ZSH and and Install Solarized theme on it. Lets move on.
oh-my-zsh is an expanded version of ZSH, which is provided from Ubuntu software center. So we will first install ZSH first. Enter the following commands as i mention
sudo apt-get install zsh
Now install oh-my-zsh
wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O – | zsh

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@shreyasmm
shreyasmm / membersonly_wp
Last active August 29, 2015 14:03
wordpress members only
//Simply add the following code in your plugin or functions.php file to register a new shortcode called members_only
add_shortcode( 'members_only', 'members_only_shortcode' );
function members_only_shortcode( $atts, $content = null )
{
if ( is_user_logged_in() && !empty( $content ) && !is_feed() )
{
return $content;
}

Flat Design Color Palette

The colors in this palette directly relate to the new Flat design trend. Copy and paste the hex codes into your flat designs and your viewers will enjoy the show.

A Pen by Lucas Cobb on CodePen.

License.

@shreyasmm
shreyasmm / .vimrc
Last active August 29, 2015 14:06 — forked from JeffreyWay/.vimrc
set nocompatible " Disable vi-compatibility
set t_Co=256
colorscheme xoria256
set guifont=menlo\ for\ powerline:h16
set guioptions-=T " Removes top toolbar
set guioptions-=r " Removes right hand scroll bar
set go-=L " Removes left hand scroll bar
set linespace=15