Skip to content

Instantly share code, notes, and snippets.

View hassanjamal's full-sized avatar
🚀
Working from home

Hassan Jamal hassanjamal

🚀
Working from home
View GitHub Profile
@hassanjamal
hassanjamal / index.html
Created September 11, 2013 08:39
BootStrap : Starter Template
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<link rel="shortcut icon" href="../../assets/ico/favicon.png">
<title>Starter Template for Bootstrap</title>
@hassanjamal
hassanjamal / index.html
Created September 12, 2013 19:28
BootStrap : Starter
<!DOCTYPE html>
<html>
<head>
<title>Bootstrap 101 Template</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Bootstrap -->
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css">
<!-- Optional theme -->
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-theme.min.css">
@hassanjamal
hassanjamal / strpos.php
Created September 14, 2013 06:58
PHP : strpos recursive function
<?php
$mystring = 'welcome !! we are learning now string function';
$findme = 'learning';
$pos = strpos($mystring, $findme);
if ($pos === false) {
echo "The string '$findme' was not found in the string '$mystring'";
} else {
echo "The string '$findme' was found in the string '$mystring'"."\n";
<?php
$browsers = array('firefox','chrome','safari','opera','msie');
$browser = new stdClass();
preg_match('#('.implode('|',$browsers).')(/| )([^ ]+)#i',$_SERVER['HTTP_USER_AGENT'],$match);
$browser->version = round((int)$match[3]);
$match = strtolower($match[1]);
foreach($browsers as $val)
{
@hassanjamal
hassanjamal / master.blade.php
Created October 15, 2013 08:30
blade-bootstrap-master
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<!-- Bootstrap core CSS -->
{{HTML::style('/css/bootstrap.css')}}
sudo apt-get update
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password root'
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password root'
sudo apt-get install -y vim curl python-software-properties
sudo add-apt-repository -y ppa:ondrej/php5
sudo apt-get update
sudo apt-get install -y php5 apache2 libapache2-mod-php5 php5-curl php5-gd php5-mcrypt php5-readline mysql-server-5.5 php5-mysql git-core php5-xdebug
@hassanjamal
hassanjamal / gd_gradient_fill
Created November 2, 2014 10:47
GD Image fill gradient
<?php
// Test it :
// $image = new gd_gradient_fill(400,200,'ellipse','#f00','#000',0);
class gd_gradient_fill {
// Constructor. Creates, fills and returns an image
@hassanjamal
hassanjamal / StripeJs javacript code
Last active August 29, 2015 14:19
StripeJs javacript code
<script type="text/javascript" src="https://js.stripe.com/v2/"></script>
<script>
(function(){
var StripeBilling = {
init: function(){
this.form = $('#checkout-wizard');
this.submitButton = this.form.find('input[type=submit]');
var StripeKey = $('meta[name="stripe-publishable-key"]').attr('content');
$(document).ready(function() {
$('#checkout-wizard')
.formValidation({
framework: 'bootstrap',
icon: {
valid: 'fa fa-check',
invalid: 'fa fa-times',
validating: 'fa fa-refresh'
},
fields: {
<div class="row">
<div class="col-sm-6">
<h4 class="page-header"><i class="fa fa-credit-card"></i> Add Credit Card</h4>
<div class="alert alert-danger alert-dismissable" id="card-error">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
<strong class="payment-error"></strong>
</div>
<!-- Card_number Form Input -->
<div class="form-group">