Skip to content

Instantly share code, notes, and snippets.

View meSingh's full-sized avatar
😜
Making products..

Mandeep Singh meSingh

😜
Making products..
View GitHub Profile
@meSingh
meSingh / Laravel Resource - Sublime Text 2 Snippet
Last active December 12, 2015 00:18 — forked from JeffreyWay/snippet.xml
Fixed version of Laravel Resource - Sublime Text 2 Snippet, original snippet by JeffreyWay @ https://gist.github.com/3717337
<snippet>
<content><![CDATA[
// ${1} Resource
Route::get('${1}s', array('as' => '${1}s', 'uses' => '${1}s@index'));
Route::get('${1}s/(:any)', array('as' => '${1}', 'uses' => '${1}s@show'));
Route::get('${1}s/new', array('as' => 'new_${1}', 'uses' => '${1}s@new'));
Route::get('${1}s/(:any)/edit', array('as' => 'edit_${1}', 'uses' => '${1}s@edit'));
Route::post('${1}s', '${1}s@create');
Route::put('${1}s/(:any)', '${1}s@update');
Route::delete('${1}s/(:any)', '${1}s@destroy');
<?php
$mysql_host = 'localhost';
$mysql_user = '';
$mysql_pass = '';
$mysql_base = 'wordpress_database';
$old_domain = 'http://blog.gbaptista.com';
$new_domain = 'http://local.blog.gbaptista.com';
@meSingh
meSingh / add_admin.sql
Created April 5, 2013 20:02
Add a admin user in your WordPress database.
-- Step 1 Add the user
-- Change db_wordpress to DB name
-- Change wp_ to your table prefix
-- Change username, pass, nicename, email, url, displayname and pass to your new user info
-- Change date to whenever you want the registered date to be
INSERT INTO `db_wordpress`.`wp_users` (`ID`, `user_login`, `user_pass`, `user_nicename`, `user_email`, `user_url`, `user_registered`, `user_activation_key`, `user_status`, `display_name`) VALUES (NULL, 'username', MD5('pass'), 'nicename', 'email', 'url', '2010-10-08 00:00:00', '', '0', 'displayname');
-- Step 2 Add permissions
-- Find the userid that was just created (int)
-- Replace id with the user id
INSERT INTO `db_wordpress`.`wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, 'id', 'wp_capabilities', 'a:1:{s:13:"administrator";b:1;}');
@meSingh
meSingh / index.html
Created April 5, 2013 20:06
Back To Top button easing with jQuery
<a href="javascript:void(0)" class="backtotop">Back to Top</a>
<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js'></script>
<script type='text/javascript'> jQuery('.backtotop').click(function(){ jQuery('html, body').animate({scrollTop:0}, 'slow'); }); </script>
@meSingh
meSingh / sublime-text-installation-instructions.md
Last active June 7, 2020 16:20
Sublime Text Installation Instructions for Ubuntu 13.04 and Elementary OS Luna

Sublime Text 2 Installation Guide: Ubuntu 13.04 and Elementary OS Luna

1. Install Sublime Text 2

Open terminal

sudo add-apt-repository ppa:webupd8team/sublime-text-2
sudo apt-get update
sudo apt-get install sublime-text

2. Install Sublime Package Control

@meSingh
meSingh / custom.js
Created May 21, 2013 11:42
This is the PingClan v1.2 bugfix. Please replace the code in your /views/default/assets/js/custom.js file with this code.
$(function() {
var html = $('html, body'),
results = $('results'),
domainPing = $('#domain-ping');
$('#search').on('submit', function() {
// Scroll to result area on form submit
html.delay(1100).animate({

Launch Sublime Text 2 from the Mac OS X Terminal

Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.

open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl

You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html

Installation

@meSingh
meSingh / fetch-all-branches.md
Last active December 18, 2015 15:28
How to fetch all branches and add trackers after cloning a repo in git.

How to fetch all branches and add trackers after cloning a repo in git

1. Clone a repo

First of all clone a git repo to a local directory.

git clone git@yoursite.org:username/repo.git localFolder

2. Run the bash script

# laravel new-app
alias laravel="git clone -o laravel -b develop https://github.com/laravel/laravel.git"
alias artisan="php artisan"
alias migrate="php artisan migrate"
alias serve="php artisan serve"
alias dump="php artisan dump"
alias t="phpunit"
# Generators Package
@meSingh
meSingh / custom.js
Created June 20, 2013 05:54
Link to a specific tab in bootstrap
var gotoHashTab = function (customHash) {
var hash = customHash || location.hash;
var hashPieces = hash.split('?'),
activeTab = $('[href=' + hashPieces[0] + ']');
activeTab && activeTab.tab('show');
}
// onready go to the tab requested in the page hash
gotoHashTab();