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 / List.md
Last active August 29, 2015 14:08 — forked from msurguy/List.md

Other people's projects:

My projects (tutorials are on my blog at http://maxoffsky.com):

@meSingh
meSingh / gist:817f4d85f2094bd7d89b
Last active August 29, 2015 14:25 — forked from pitch-gist/gist:2999707
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@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 / 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({
@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

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 / 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();
@meSingh
meSingh / .htaccess
Created June 20, 2013 11:42
Laravel's (L3) .htaccess to remove "public" from URL
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)$ public/$1 [L]
</IfModule>