#Example Problem:
Expression #9 of SELECT list is not in GROUP BY clause and contains nonaggregated column
'table.column' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
#Solved With:
use your_db;
SET sql_mode = '' ;
#or
SET GLOBAL sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));
#or config mysql service
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
| <?php | |
| //Just uploading photo or attachments | |
| require_once(ABSPATH . "wp-admin" . '/includes/image.php'); | |
| require_once(ABSPATH . "wp-admin" . '/includes/file.php'); | |
| require_once(ABSPATH . "wp-admin" . '/includes/media.php'); | |
| $file_handler = 'upload_attachment' //Form attachment Field name. | |
| $attach_id = media_handle_upload( $file_handler, $post_id ); |
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
| <?php | |
| $file = '/path/to/file.png'; | |
| $filename = basename($file); | |
| $upload_file = wp_upload_bits($filename, null, file_get_contents($file)); | |
| if (!$upload_file['error']) { | |
| $wp_filetype = wp_check_filetype($filename, null ); | |
| $attachment = array( | |
| 'post_mime_type' => $wp_filetype['type'], | |
| 'post_parent' => $parent_post_id, |
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
| try { | |
| navigator.serviceWorker.getRegistrations().then(function(registrations) { | |
| registrations.forEach(function(registration) { | |
| console.log('removing registration', registration); | |
| registration.unregister(); | |
| }) | |
| }) | |
| } | |
| catch (e) { | |
| console.log('failed to unregister all service workers', e); |
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
| <?php | |
| /** | |
| * saya memiliki contoh JSON dalam bentuk string | |
| */ | |
| $stringJson = '{"message":[{"id":"23","description":"AXIS 5000","code":"AX5","code_alias":"AH5","substitute":"1","price":"5419","profit_max":"160","h2h":"5419","h2h_lock":"0","h2h_max":"100","price_host":"5319","nominal":"5000","operator":"AXIS","operator_sub":"AX","supplier":"lumbung","publish":"1","status":"normal","block":"0","date_update":"2016-01-26 13:35:02","provider":"AXIS","provider_sub":"REGULER"},{"id":"28","description":"AXIS 10000","code":"AX10","code_alias":"AH10","substitute":"1","price":"10419","profit_max":"160","h2h":"10419","h2h_lock":"0","h2h_max":"100","price_host":"10319","nominal":"10000","operator":"AXIS","operator_sub":"AX","supplier":"lumbung","publish":"1","status":"normal","block":"0","date_update":"2016-02-09 07:20:02","provider":"AXIS","provider_sub":"REGULER"}]}'; | |
| /** | |
| * Disini Saya merubah dari format string Json ke |
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 apt-get install python-virtualenv python-pip | |
| $ virtualenv chatBot # chatBot <-- Nama Virtual Env & Boleh anda ganti | |
| $ cd chatBot && source bin/activate | |
| $ # disebelah kanan (chatbot) menandakan virtualenv telah aktiv | |
| (chatbot)$ git clone https://github.com/dev-makassar/ChatBot.git && cd ChatBot | |
| (chatbot)$ pip install -r requirements.txt | |
| (chatbot)$ # Dependencies atau library yang dibutuhkan selesai di tambahkan ke virtualenv |
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
| $ git clone https://github.com/dev-makassar/ChatBot.git && cd ChatBot | |
| $ pip install -r requirements.txt --user | |
| $ # Dependencies atau library yang dibutuhkan selesai di tambahkan ke virtualenv |
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 flask import Flask | |
| # deklarasi variabel app untuk menampung atau membangun Object Class Framework Flask | |
| app = Flask(__name__) | |
| # deklarasi variable config untuk mengatur konfigurasi dasar dari flask | |
| # port untuk port app flask saat di jalankan | |
| # debug untuk mengaktivkan mode debug jika bernilai benar (True) | |
| config = { | |
| 'port': 5000, |
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 flask import Flask, request | |
| # jangan lupa tambahkan request pada import Flask Library | |
| .... | |
| VerifyToken='V3rifyT0k3N' | |
| @app.route('/webhook', methods=['GET']) | |
| def webhook(): | |
| if request.method == 'GET': | |
| if request.args.get("hub.verify_token") == VerifyToken: | |
| return request.args.get("hub.challenge") | |
| else: |
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
| rabbitmqctl add_user test test | |
| rabbitmqctl set_user_tags test administrator | |
| rabbitmqctl set_permissions -p / test ".*" ".*" ".*" |