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
DELIMITER $$ | |
CREATE TRIGGER on_items_update | |
AFTER INSERT | |
ON order_items FOR EACH ROW | |
BEGIN | |
UPDATE orders SET total_photos=total_photos+1 WHERE id=new.order_id; | |
END$$ | |
DELIMITER ; |
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
postData('notes/update_note_date', { | |
id: element.parentElement.getAttribute("data-id"), | |
lead_id: element.parentElement.getAttribute('data-lead'), | |
note_type: element.parentElement.getAttribute('data-type'), | |
field: element.parentElement.getAttribute('data-field'), | |
value: element.value | |
}).then(data => { | |
console.log(data); // JSON data parsed by `data.json()` call | |
}); |
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>Sandbox</title> | |
<meta charset="UTF-8" /> | |
</head> | |
<body> | |
<div class="editable date" data-id="6">2021-09-23</div> | |
<div class="editable date" data-id="1">2011-08-11</div> |
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 | |
/** | |
* Extended / Overloaded CI-Upload Class to handle Flash-Form-Uploaded Images via Application/octet-stream | |
* | |
*/ | |
if (!defined('BASEPATH')) exit('No direct script access allowed'); | |
/** | |
* Extends the CodeIgniter Upload-Class | |
*/ |
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 | |
$data = []; | |
// www-form-urlencoded | |
$opts = array('http' => array('method' => 'POST', | |
'header' => 'Content-Type: application/x-www-form-urlencoded', | |
'content' => http_build_query($data) | |
)); | |
// json |
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
var timeoutId; | |
$(document).on('keypress', '#overview', function () { | |
if (timeoutId) clearTimeout(timeoutId); | |
let brief = $(this).val() | |
let steps_id = $(this).data('id') | |
timeoutId = setTimeout(function () { | |
$.ajax({ |
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 | |
// Downgrade to jQuery given version | |
function downgrade_jquery() { | |
global $wp_scripts; | |
// We want to use version 1.8.3 of jQuery, but it may break something in the admin so we only load it on the actual site. | |
if ( !is_admin() ) : | |
wp_deregister_script('jquery'); | |
wp_register_script('jquery', '//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js', false, '1.8.2'); | |
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
package main | |
import ( | |
exif "github.com/dsoprea/go-exif/v3" | |
exifcommon "github.com/dsoprea/go-exif/v3/common" | |
jpeg "github.com/dsoprea/go-jpeg-image-structure/v2" | |
) | |
func setExifTag(rootIB *exif.IfdBuilder, ifdPath, tagName, tagValue string) error { |
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
FROM golang:latest AS base | |
RUN apt-get update && \ | |
apt-get -y --no-install-recommends install software-properties-common && \ | |
add-apt-repository "deb http://httpredir.debian.org/debian bullseye main" && \ | |
apt-get update && \ | |
apt-get -qq install -y libvips-dev && rm -rf /var/lib/apt/lists/* | |
WORKDIR /app |
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
"columnDefs": [ | |
{"className": 'nowrap', 'targets': [0, 1, 4]}, | |
{"className": 'text-right', 'targets': [10, 11, 13, 14, 15, 16, 21, 23]}, | |
// {"render": $.fn.dataTable.render.moment( 'Do MMM YYYY' , 'YYYY-MM-DD' ), 'targets' : [8]} | |
], |