Skip to content

Instantly share code, notes, and snippets.

@Rakesh-webdeveloper
Rakesh-webdeveloper / google_map.html
Last active January 9, 2018 07:45 — forked from knownasilya/index.html
Google Maps Advanced Drawing
<!DOCTYPE html>
<html>
<!-- example link http://bl.ocks.org/knownasilya/89a32e572989f0aff1f8 -->
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="UTF-8">
<title>Drawing Tools</title>
<script type="text/javascript"
src="http://maps.google.com/maps/api/js?sensor=false&libraries=drawing"></script>
<style type="text/css">
@Rakesh-webdeveloper
Rakesh-webdeveloper / xdebug_php.ini
Created January 9, 2018 11:01 — forked from birchestx/xdebug_php.ini
xdebug settings in php.ini
[xdebug]
xdebug.remote_enable=1
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
@Rakesh-webdeveloper
Rakesh-webdeveloper / xdebug-php.md
Created January 10, 2018 10:23 — forked from ankurk91/xdebug-mac.md
php xDebug on Ubuntu/Mac and phpStorm 2017

🪲 Install and Configure xDebug on Ubuntu/Mac and PhpStorm 🐘

  • Assuming that you have already installed php and apache
  • Install xDebug php extension
# Ubuntu 16.04, php 7.0
sudo apt-get install php-xdebug

# Ubuntu 14.04, php 5.6 
sudo apt-get install php5-xdebug
@Rakesh-webdeveloper
Rakesh-webdeveloper / git-loglive
Created March 9, 2018 18:42 — forked from tlberglund/git-loglive
Log Live Git Command
#!/bin/bash
while :
do
clear
git --no-pager log --graph --pretty=oneline --abbrev-commit --decorate --all $*
sleep 1
done

For the impatient

Set up the new bare repo on the server:

$ ssh myserver.com
Welcome to myserver.com!
$ mkdir /var/git/myapp.git && cd /var/git/myapp.git
$ git --bare init
Initialized empty Git repository in /var/git/myapp.git
$ exit
@Rakesh-webdeveloper
Rakesh-webdeveloper / text
Created April 3, 2018 07:52 — forked from d1i1m1o1n/text
How to disable auto-save in phpstorm
How to disable auto-save:
Go to File > Settings (Ctrl+Alt+S).
Go to Appearance & Behavior > System Settings.
Make sure the two are unchecked:
Save files on frame deactivation
Save files automatically if application is idle for x sec.
Go to Editor > General > Editor Tabs
Put a checkmark on "Mark modified files with asterisk"
(Optional but recommended) Under "Tab Closing Policy", select "Close non-modified files first". You may also want to increase the number of allowed tabs.
Click Apply > OK.
<?php
/**
* Get Google Page Speed Screenshot
*
* Uses Google's Page Speed API to generate a screenshot of a website.
* Returns the image as a base64 jpeg image tag
*
* Usage Example:
* echo getGooglePageSpeedScreenshot("http://ghost.org", 'class="thumbnail"');
*
@Rakesh-webdeveloper
Rakesh-webdeveloper / layout.htm
Created April 25, 2018 12:03 — forked from AdamAlinauskas/layout.htm
Web page layout using divs with a header, footer, right sidebar, left sidebar and an area for main content.
<html>
<head>
<style>
#header{
background-color: lightblue;
width:100%;
height:50px;
text-align: center;
}
@Rakesh-webdeveloper
Rakesh-webdeveloper / mysql-triggers.sql
Created May 10, 2018 07:48 — forked from anytizer/mysql-triggers.sql
The mysql triggers examples
# INSERT
# -- before: Check uniqueness
# -- after:
# UPDATE
# -- before: Log old data
# -- after: Email admin queue
# DELETE
# -- before: check for dues
# -- after: System cleanup
@Rakesh-webdeveloper
Rakesh-webdeveloper / youtube_id_regex.php
Created August 1, 2018 06:34 — forked from ghalusa/youtube_id_regex.php
Extract the YouTube Video ID from a URL in PHP
<?php
// Here is a sample of the URLs this regex matches: (there can be more content after the given URL that will be ignored)
// http://youtu.be/dQw4w9WgXcQ
// http://www.youtube.com/embed/dQw4w9WgXcQ
// http://www.youtube.com/watch?v=dQw4w9WgXcQ
// http://www.youtube.com/?v=dQw4w9WgXcQ
// http://www.youtube.com/v/dQw4w9WgXcQ
// http://www.youtube.com/e/dQw4w9WgXcQ
// http://www.youtube.com/user/username#p/u/11/dQw4w9WgXcQ