This file contains hidden or 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
$(function () { | |
let data_table = $('#data-table'); | |
let data_table_object = null; | |
fetch_data() | |
function fetch_data() { | |
if (data_table_object != null) { | |
data_table_object.destroy(); | |
} | |
data_table_object = data_table.DataTable({ |
This file contains hidden or 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
$data = User::all(); | |
$dataTable = DataTables::collection($data) | |
->editColumn('check_box', static function ($value) { | |
return '<td> | |
<div class="checkbox"> | |
<input type="checkbox" name="check" value="checkbox" class="row-check-box-active-table"> | |
<label for="checkbox"></label> | |
</div> | |
</td>'; | |
})->editColumn('profile_pic_and_name', static function ($value) { |
This file contains hidden or 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
let certificate_search_ele = $('#certificate-search'); | |
let certificate_list_text_ele = $('.certificate-list-text'); | |
let certificate_category_ele = $('#certificate_category'); | |
function applyFilters() { | |
/*Search Filter */ | |
let value = certificate_search_ele.val().toLowerCase(); | |
certificate_list_text_ele.filter(function () { | |
$(this).toggle($(this).text().toLowerCase().indexOf(value) > -1) |
This file contains hidden or 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
# index.php | |
<?php | |
$REQUEST_URI = $_SERVER['REQUEST_URI']; | |
$REQUEST_URI_split = explode('/',$REQUEST_URI); | |
$SCRIPT_NAME = $_SERVER['SCRIPT_NAME']; | |
$SCRIPT_NAME_split = explode('/',$SCRIPT_NAME); | |
$intersection_length = count(array_intersect($REQUEST_URI_split,$SCRIPT_NAME_split)); |
This file contains hidden or 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><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
<title>The page you were looking for doesn't exist (404)</title> | |
<meta name="robots" content="noindex"> | |
<style type="text/css"> | |
body { | |
background:#fafafa; | |
font-family: 'Open Sans', sans-serif; | |
font-weight:300; | |
color:#979997; |
This file contains hidden or 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
import requests | |
from bs4 import BeautifulSoup | |
import time | |
search = input('Search: ') | |
searched_url = 'https://www.google.com/search?q='+search.replace(' ','+') | |
# googling | |
page = requests.get(searched_url) |
This file contains hidden or 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
<script> | |
$(function () { | |
function getLocation() { | |
if (navigator.geolocation) { | |
navigator.geolocation.getCurrentPosition(fetchPosition); | |
} else { | |
$('.wether-section').hide(); | |
console.log("Geolocation is not supported by this browser."); | |
} | |
} |
This file contains hidden or 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
// From: http://stackoverflow.com/questions/3596583/javascript-detect-an-ajax-event | |
var s_ajaxListener = new Object(); | |
s_ajaxListener.tempOpen = XMLHttpRequest.prototype.open; | |
s_ajaxListener.tempSend = XMLHttpRequest.prototype.send; | |
s_ajaxListener.callback = function () { | |
// this.method :the ajax method used | |
// this.url :the url of the requested script (including query string, if any) (urlencoded) | |
// this.data :the data sent, if any ex: foo=bar&a=b (urlencoded) | |
console.log(this.method); |
This file contains hidden or 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
// let audio_url = 'https://media.licdn.com/media/AAMBAQQiAAgAAQAAAAAAAAriAAAAJDg2ZWY0MzhjLWQ5YTUtNDgyMy1hZjQ3LWYzM2RlOWRjZmZkYg.bin'; | |
let audio_url = 'https://fsb.zobj.net/download/bSCIjtRQgjq9_Y6tM5IdFilYEp18rUjolRsAWyFRQ54YLXrhcs8YkPqexUvo6-8y_FSaAVLZTBAxgRJyfyJmkHU_XtboIwuG6xprhiQl9xn2FXkpi41Y0DUq7nNU/?a=web&c=72&f=small_town_boy.mp3&special=1617478235-s9coL3BX6o9WBKgaxaZf6upK89ytW4oVqSGzPyFIsZY%3D'; | |
let audio = new Audio(audio_url); | |
document.getElementsByClassName('msg-thread')[0].addEventListener("DOMSubtreeModified", function() { | |
if( typeof play_audio_trigger !== 'undefined'){ | |
clearTimeout(play_audio_trigger); | |
} | |
play_audio_trigger = setTimeout(function(){ | |
play_audo(); |
This file contains hidden or 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
sudo chown -R www-data:www-data html/ | |
sudo usermod -a -G www-data root | |
sudo find html/ -type f -exec chmod 644 {} \; | |
sudo find html/ -type d -exec chmod 755 {} \; | |
cd html/ | |
sudo chgrp -R www-data storage bootstrap/cache | |
sudo chmod -R ug+rwx storage bootstrap/cache | |
reference: https://stackoverflow.com/a/37266353 |