Skip to content

Instantly share code, notes, and snippets.

View ravinsharma12345's full-sized avatar

Ravin ravinsharma12345

View GitHub Profile
@ravinsharma12345
ravinsharma12345 / Apache Virtual Host
Last active December 20, 2015 20:49
Configuration for Local Virtual Host in Xampp for Windows
#Assumption xampp path is C:\xampp
#configuration for virtual host on local machine for development and staging.
#locate http-vhosts.conf, and paste the configuration below. ( Edit path, port, server name as necessary). In my case is C:\xampp\apache\conf\extra\httpd-vhosts.conf
#make sure the path for the error,and access logs exists; error log and access log are not mandatory.
#add a domain name in your hosts file, in my case is "dev", located under C:\Windows\System32\drivers\etc (Windows 7)
#restart and have fun
<VirtualHost dev:80>
ServerAdmin postmaster@stage
@ravinsharma12345
ravinsharma12345 / shutdown_notify
Last active December 21, 2015 00:09
Graceful shutdown for php fatal error. When error occurs, get last error and send me and email about it.
<?php
register_shutdown_error('shutdown_notify');
function shutdown_notify(){
$error = error_get_last();
if(!empty($error) && in_array($error['type'], array(E_ERROR, E_USER_ERROR))){
echo '<h1>An error has occured. Team has been notified of the error</h1>';
$to = 'example@email.com';
@ravinsharma12345
ravinsharma12345 / Xdebug php.ini
Last active December 21, 2015 00:49
Xdebug configuration on Xampp
[XDebug]
zend_extension = "C:\xampp\php\ext\php_xdebug-2.2.3-5.4-vc9.dll"
xdebug.profiler_append = 0
xdebug.profiler_enable = 0
xdebug.profiler_enable_trigger = 0
xdebug.profiler_output_dir = "C:\xampp\tmp"
xdebug.profiler_output_name = "cachegrind.out.%t-%s"
xdebug.remote_enable = 1
xdebug.remote_handler = "dbgp"
@ravinsharma12345
ravinsharma12345 / sublime stuff
Created August 14, 2013 17:45
Random stuff, no time to arrange.
{
"scope": "text.html - source - meta.tag, punctuation.definition.tag.begin",
"completions":
[
{ "trigger": "a", "contents": "<a href=\"$1\">$0</a>" },
{ "trigger": "abbr", "contents": "<abbr>$0</abbr>" },
{ "trigger": "acronym", "contents": "<acronym>$0</acronym>" }
]
@ravinsharma12345
ravinsharma12345 / Unicode Math conf
Last active December 21, 2015 02:59
My sublime text 2 Unicode Math plugin configuration
{
"symbols": {
"x0" : "\u2070",
"x1" : "\u00B9",
"x2" : "\u00B2",
"x3" : "\u00B3",
"x4" : "\u2074",
"x5" : "\u2075",
"x6" : "\u2076",
"x7" : "\u2077",
@ravinsharma12345
ravinsharma12345 / vagrant commands
Created August 15, 2013 10:19
List of vagrant of command (Incomplete)
vagrant up => wake up, rise my child
vagrant halt => shut the f up, and stand down
vagrant suspend => freeze u motherfucker
vagrant destroy => die! die!
vagrant add box "url of box" => collecting the carbon for the offspring
vagrant init => dna blueprint for offspring
vagrant ssh => soul link
vagrant resume => unfreeze u motherfucker
@ravinsharma12345
ravinsharma12345 / jQuery pastebin
Last active December 21, 2015 04:28
I'm trying to get a grab on jQuery. This is to document how it works and some context on using jQuery
<!doctype html>
<html lang="en">
<meta charset="utf-8">
<title>Demo</title>
<! -- javascript allow wizards to manipulate the world of DOM, DOM is a world that can display all sorts of knowledge
and we shall use the power of javascript -->
<!-- javascript has a lot of power, but there a dimensional issue involving browser universe . Each universe has different behaviour to javascript. To resolve this issue, jQuery is an advance universal magic that is founded on javascript used for cross dimensional DOM manipulation. We shall learn jQuery in this bin -->
<head>
<!-- loading jquery from cdn source -->
<script type="text/javscript" src="http://codeorigin.jquery.com/jquery-2.0.3.min.js"> </script>
@ravinsharma12345
ravinsharma12345 / php syntax
Created August 17, 2013 05:05
php in z minutes
<?php
//This is a s comment
/**
This is a block comment
**/
print("Outputing some strings");
echo "Echoing some strings and string formatter\n";
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Jquery Welcome</title>
<script type="text/javscript" src="http://codeorigin.jquery.com/jquery-2.0.3.min.js"></script>
<script type="text/javscript">
//before we go further, jquery has certain types of material it can manipulate.
//this materials are virtual types, enhanced pseudo-types, function types
@ravinsharma12345
ravinsharma12345 / alogrithm_analysis
Created August 20, 2013 11:13
Some notes on algorithm analysis
asymptotic analysis(mathematical formalization)
- Basic vocabulary to discuss design and analysis of algorithms
- focuses on the "sweet spot" to suppress architecture/language/compiler dependent details.
- sharp enough to make useful comparisons between different alogrithms, especially on large inputs.
- suppress constant factors and lower-order terms.
- lower order terms are irrelevant for large inputs, constant factors are too system dependent.
Example: One loop
Problem: Does array A contain the integer t?
given A (array of length n)