This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Bubble Sort in Javascript | |
var data = [23,87,21,3,9,11,98,45,31]; | |
for(var i=0; i< data.length; i++){ | |
//Last i digits already sorted | |
for(var j = 0; j < (data.length - i - 1); j++){ | |
if(data[j+1] < data[j]){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Reverse integer number without loop in Javascript | |
var num = 34562; | |
var reversed = 0; | |
while(num > 1){ | |
var last_digit = num % 10; | |
reversed = reversed * 10 + last_digit; | |
num = parseInt(num/10); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Middleware; | |
use Closure; | |
class SecureHeadersMiddleware | |
{ | |
// Enumerate headers which you do not want in your application's responses. | |
// Great starting point would be to go check out @Scott_Helme's: | |
// https://securityheaders.com/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<IfModule mod_rewrite.c> | |
<IfModule mod_negotiation.c> | |
Options -MultiViews | |
</IfModule> | |
RewriteEngine On | |
RewriteCond %{REQUEST_FILENAME} -d [OR] | |
RewriteCond %{REQUEST_FILENAME} -f | |
RewriteRule ^ ^$1 [N] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$users = new User; | |
$usersArray = $users->select("col1",'col2','col3') | |
->where('life_member','1')->get()->toArray(); | |
$storage_path = public_path().'/files'; | |
$curr_date = Carbon::now(); | |
Excel::create('export_life_members',function ($excel) use($usersArray,$curr_date){ | |
// Set the title | |
$excel->setTitle("Exported Life Members on $curr_date"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//JS side Configuration | |
$("#user_emails").select2({ | |
ajax: { | |
url:"/api/yourown", | |
dataType: 'json', | |
delay: 250, | |
data: function (params) { | |
return { | |
q: params.term, // search term |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@if (count($errors) > 0) | |
<div class="alert alert-danger"> | |
<strong>Whoops!</strong> There were some problems with your input.<br><br> | |
<ul> | |
@foreach ($errors->all() as $error) | |
<li>{{ $error }}</li> | |
@endforeach | |
</ul> | |
</div> | |
@endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>DB-Convert</title> | |
<style> | |
body { font-family:"Courier New", Courier, monospace;" } | |
</style> | |
</head> | |
<body> |