Skip to content

Instantly share code, notes, and snippets.

View sohelamin's full-sized avatar
🎯
Focusing

Sohel Amin sohelamin

🎯
Focusing
View GitHub Profile
@sohelamin
sohelamin / mysql-dump.php
Created August 21, 2014 07:17
Mysql Dump Script
<?php
set_time_limit(0);
/*---------------------------------------------------+
| mysqldump.php
+----------------------------------------------------+
| Copyright 2006 Huang Kai
| hkai@atutility.com
| http://atutility.com/
+----------------------------------------------------+
| Released under the terms & conditions of v2 of the
<?php
/**
* An helper file for Laravel 4, to provide autocomplete information to your IDE
* Generated for Laravel 4.2.8 on 2014-08-26.
*
* @author Barry vd. Heuvel <barryvdh@gmail.com>
* @see https://github.com/barryvdh/laravel-ide-helper
*/
namespace {
@sohelamin
sohelamin / multiple-form-submit.php
Created September 23, 2014 08:48
Multiple Form Submitt Simultaneously Via Jquery-Ajax
<script>
function submitAllForm() {
$('form').each(function (index, value) {
//iteration
var $form = $(this);
var form_id=$form.attr("id");
if(form_id!='client_details'&&form_id!='hvac'&&form_id!='bms'&&form_id!='refrigeration_equipment'&&form_id!='lighting'){
$.post($form.attr("action"), $form.serialize(), function (response) {
$form.attr("action", "<?php echo base_url('admin/clientDetailsUpdate');?>");
<?php if($this->uri->segment(2)=='clientDetailsAdd'){?>
@sohelamin
sohelamin / mysql-singletone.php
Last active August 29, 2015 14:08
Mysqli Singleton Class
<?php
/**
* Created by AppzCoder.
* User: SOHEL AMIN
* Date: 10/30/2014
* Time: 1:20 AM
* URL: www.appzcoder.com
*/
class Database {
@sohelamin
sohelamin / youtube-fluid-width.js
Created February 19, 2015 12:50
YouTube video fluid width height with jquery
// By Sohel Amin www.sohelamin.com or www.appzcoder.com
$(function() {
// Find all YouTube videos
var $allVideos = $("iframe[src^='http://www.youtube.com']"),
// The element that is fluid width
$fluidEl = "div.youtube-wrapper";
// Figure out and save aspect ratio for each video
$allVideos.each(function() {
$(this)
.data('aspectRatio', this.height / this.width)
@sohelamin
sohelamin / re-captcha.html
Last active August 29, 2015 14:16
Re-captcha responsive width
<html>
<head>
<title>reCAPTCHA demo: Simple page</title>
<script src="https://www.google.com/recaptcha/api.js" async defer></script>
</head>
<body>
<form action="?" method="POST">
<div class="g-recaptcha" data-theme="light" data-sitekey="<YOUR_SITE_KEY>" style="transform:scale(0.77);transform-origin:0 0"></div>
<br/>
<input type="submit" value="Submit">
@sohelamin
sohelamin / stick-header.html
Created March 19, 2015 06:44
Stick Header Menu while scrolling down
<!DOCTYPE html>
<html>
<header>
<title>Stick Header</title>
<style>
.stick-header {
width: 100%;
z-index: 99999;
position: fixed;
}
@sohelamin
sohelamin / bangla-date.js
Created April 15, 2015 12:31
Bangla Date
Date.prototype.addHours = function(h){
this.setHours(this.getHours()+h);
return this;
}
var timeStamp = new Date().addHours(-6);
function getBanglaDateAndMonth() {
var hours = timeStamp.getHours();
var date = timeStamp.getDate();
@sohelamin
sohelamin / lumen-resource-route.php
Created April 20, 2015 18:34
Lumen Resource Routing
<?php
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
@sohelamin
sohelamin / http-status-codes.php
Created April 23, 2015 09:05
HTTP Status Codes in a PHP Array
<?php
/**
* Codes collected from http://en.wikipedia.org/wiki/List_of_HTTP_status_codes
**/
$http_status_codes = array(
100 => 'Informational: Continue',
101 => 'Informational: Switching Protocols',
102 => 'Informational: Processing',
200 => 'Successful: OK',