Skip to content

Instantly share code, notes, and snippets.

@hemantajax
hemantajax / set-path-in-mac
Last active December 11, 2015 11:18
setting path in MAC
#setting path in MAC
1: go to /Users/hemant create a file .bash_profile
2: add below lines to set new path ( for ex. I am adding MAMP php path)
export MAMP_PHP=/Applications/MAMP/bin/php/php5.4.4/bin
export PATH="$MAMP_PHP:$PATH"
3: save it
4: check it => php -v
@hemantajax
hemantajax / latest-clearfix
Created January 21, 2013 17:55
latest clearfix
/**
* For modern browsers
*/
.cf:before,
.cf:after {
content: " "; /* 1 */
display: table; /* 2 */
}
.cf:after {
@hemantajax
hemantajax / backbone.html
Created January 18, 2013 11:55
Backbone Template
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="utf-8" />
<style>
</style>
</head>
<body>
@hemantajax
hemantajax / insertNewItem.html
Created December 4, 2012 08:38
Inserting Items in a Sorted List with jQuery
<!doctype html>
<html>
<head>
<title></title>
<meta charset="utf-8" />
<style>
ul,li{
margin: 0;
padding: 0;
list-style: none;
@hemantajax
hemantajax / css-click.html
Created October 7, 2012 05:26
click with css3
<!doctype html>
<html>
<head>
<title>click wit css3</title>
<meta charset="utf-8" />
<style>
#wrapper{
width: 600px;
margin: 20px auto;
@hemantajax
hemantajax / web-performance.html
Created October 1, 2012 08:30
web performance tips
Web Performance:
1: Turn on http compression: GZipping:
☐ test here
http://gzipwtf.com/
☐ copy below lines to htaccess in your root folder (get latest from here https://github.com/h5bp/html5-boilerplate/blob/master/.htaccess)
# ----------------------------------------------------------------------
@hemantajax
hemantajax / css-tringle.html
Created September 14, 2012 07:35
css tringles with css
<!doctype html>
<html>
<head>
<title>css tringles</title>
<meta charset="utf-8" />
<style>
.chat-bubble {
background-color:#EDEDED;
border:2px solid #ccc;
font-size:35px;
@hemantajax
hemantajax / file-manipulation.php
Created September 1, 2012 14:27
using glob to manipulate file
<?php
$images=glob("images/*.{png,jpg,jpeg}",GLOB_BRACE);
foreach ($images as $img) {
$pathinfo=pathinfo($img);
$thumb=$pathinfo['filename']."-thumb.".$pathinfo['extension']."<br />";
echo $thumb;
}
?>
@hemantajax
hemantajax / center.html
Created June 9, 2012 04:16
Centering div using pure css
<!doctype html>
<html>
<head>
<title>Centering div using pure css</title>
<meta charset="utf-8" />
<style>
.outer{
position: absolute;
top: 50%;
left: 0px;
@hemantajax
hemantajax / promise-with-animation.html
Created May 28, 2012 06:03
promise with animation
<!doctype html>
<html>
<head>
<title></title>
<meta charset="utf-8" />
<style>
#wrapper div{
float:left;
width:200px;
height:200px;