Skip to content

Instantly share code, notes, and snippets.

View tarekmonjur's full-sized avatar

Tarek Monjur tarekmonjur

View GitHub Profile
@tarekmonjur
tarekmonjur / slug.js
Created February 11, 2018 20:10 — forked from bentruyman/slug.js
JavaScript Slug Generator
// Generates a URL-friendly "slug" from a provided string.
// For example: "This Is Great!!!" transforms into "this-is-great"
function generateSlug (value) {
// 1) convert to lowercase
// 2) remove dashes and pluses
// 3) replace spaces with dashes
// 4) remove everything but alphanumeric characters and dashes
return value.toLowerCase().replace(/-+/g, '').replace(/\s+/g, '-').replace(/[^a-z0-9-]/g, '');
};
Route::get('/csv', function() {
$table = ApplyOnline::all();
$output = "Company Name,Company Address,Product Lineup,Name of Company Owner,Address of Company Owner,NID of Authorized Person,Company Trade License No,Company TIN No,Contact No,Repersentative,Email,Website\n";
$count= 0;
foreach ($table as $data) {
$output.= $data->companyname.",";
$output.= $data->companyaddress.",";
$output.= $data->lineup.",";
$output.= $data->companyowner.",";
@tarekmonjur
tarekmonjur / goto-sublime
Created December 17, 2015 10:42 — forked from kendellfab/goto-sublime
Add mouse click `goto definition` in sublime text 3.
Linux - create "Default (Linux).sublime-mousemap" in ~/.config/sublime-text-3/Packages/User
Mac - create "Default (OSX).sublime-mousemap" in ~/Library/Application Support/Sublime Text 3/Packages/User
Win - create "Default (Windows).sublime-mousemap" in %appdata%\Sublime Text 3\Packages\User
[
{
"button": "button1",
"count": 1,
"modifiers": ["ctrl"],
"press_command": "drag_select",
public function fileView($id){
$photo_object =Notice::findOrFail($id);
$headers = array('Content-Type' => 'pdf');
$response = \Response::download(public_path('notice_uploads/'.$photo_object->file), $photo_object->file, $headers);
ob_end_clean();
return $response;
}
In Blade.php
{!! Form::open(['url' => 'product', 'method' => 'POST', 'class'=>'dropzone','id'=>'dropzone_file_upload']) !!}
<!-- text input -->
<div class="form-group">
<label>Product Title</label>
<input type="text" required name="title" class="form-control" placeholder="Enter ...">
</div>
<!-- textarea -->
<?php
namespace App\Exceptions;
use Exception;
use Symfony\Component\HttpKernel\Exception\HttpException;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
class Handler extends ExceptionHandler
{