Skip to content

Instantly share code, notes, and snippets.

View XDavidT's full-sized avatar
👨‍💻
If you can dream it you can code it

David Tayar XDavidT

👨‍💻
If you can dream it you can code it
View GitHub Profile
@XDavidT
XDavidT / ISO-639-1-language.json
Last active March 20, 2020 14:57 — forked from jrnk/ISO-639-1-language.json
ISO 639-1 Alpha-2 codes of languages JSON
[
{
"code": "ab",
"name": "Abkhaz"
},
{
"code": "aa",
"name": "Afar"
},
{
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<TextView
//rules table//
$.getJSON('/api/policy/data2table',function(data){
$(document).ready(function() {
var table = $('#RuleDataTable').DataTable({
orderCellsTop: true,
fixedHeader: true,
data:data,
"pageLength": 5,
logs_router.post('/loadata',(req,res)=>{
try{
//Checking parameters from DataTables query
//Order
const orderBy = {}
var orderType = 1
if(req.body['order'][0]['dir'] == 'desc') {orderType = -1}
orderBy[req.body['columns'][req.body['order'][0]['column']]['data']] = orderType
//Search
$.getJSON('/api/logs/data2table',function(data){
$(document).ready(function() {
$('#dataTableLogs thead tr').clone(true).appendTo( '#dataTableLogs thead' );
$('#dataTableLogs thead tr:eq(1) th').each( function (i) {
var title = $(this).text();
$(this).html( '<input type="text" placeholder="Search '+title+'" />' );
$( 'input', this ).on( 'keyup change', function () {
if ( table.column(i).search() !== this.value ) {
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">