Skip to content

Instantly share code, notes, and snippets.

View kwbtdisk's full-sized avatar
😆
Am exciting building Application in JS/TS

Daisuke Kawabata kwbtdisk

😆
Am exciting building Application in JS/TS
View GitHub Profile
@kwbtdisk
kwbtdisk / modelDefinitions.otherColAttributes.js
Created October 31, 2021 02:38
CORE Framework 他のカラムの入力値に応じて、カラムの表示/非表示を切り替える (`enableIf: (row) => boolean` 関数を利用する)
// Model定義 のカラムの "JS形式の追加カラム定義" へ追記
{
enableIf: (row) => {
// 経費申請Modelで "金額が5000円以上のときにのみ" imageカラムを表示させる
// console.log(row)
// debugger
return row.amount >= 5000
}
}
@kwbtdisk
kwbtdisk / utils-for-elementor.css
Last active April 23, 2019 04:48
Utility CSS for Elementor
/* Display */
.d-inline-block { display:inline-block !important; }
.d-block { display:block !important; }
.d-inline { display:inline !important; }
.d-block { display:block !important; }
/* Float */
.float-left { float:left; }
.float-right { float:right; }
/* Full-width button */
.button-block .elementor-button { display:block !important; }
@kwbtdisk
kwbtdisk / dl_from_gdrive.sh
Created April 8, 2019 02:45
Download a large file on google drive with curl on linux
FILE_ID="xxxxxxxxxxxxxxxxxxxx"
curl -sc /tmp/cookie "https://drive.google.com/uc?export=download&id=${FILE_ID}" > /dev/null
CODE="$(awk '/_warning_/ {print $NF}' /tmp/cookie)"
curl -Lb /tmp/cookie "https://drive.google.com/uc?export=download&confirm=${CODE}&id=${FILE_ID}" -o archive.zip
@kwbtdisk
kwbtdisk / in_your_functions.php
Last active October 20, 2020 02:24
[WordPress] Integration with Ajax Search Lite & Bogo (Adjust the seach query for the page's language)
// Adjust the seach query of Ajax Search Lite with Bogo
add_action('asl_query_add_args', 'ajax_search_light_and_bogo_integration', 100, 1);
function ajax_search_light_and_bogo_integration( $args ) {
global $wpdb;
// Bogo saves the page language into the cookie, so we can just pick it.
$loc = $_COOKIE['lang'];
if(!$loc) { return $args; }
$args['where'] .= <<<SQL
AND ID IN ((
@kwbtdisk
kwbtdisk / change_commit_time.sh
Created November 26, 2017 09:05
Change git commit time and author time
#!/usr/bin/env bash
usage() {
echo "Script for rewrite commit time"
echo 'Usage: ./gitignore_change_commit_time.sh --num 1 --time "$(date -v-46H)"'
echo " --num [NUM] ex: 3"
echo " --time [DATETIME] ex: 'Fri Nov 24 16:00:00 2017'"
exit 1
}
for OPT in "$@"
@kwbtdisk
kwbtdisk / gist:f0eac0927eabfa9865c69d2fd87c3cd1
Created February 9, 2017 12:23
Mautic on kusanagi nginx.conf
#=======================================
# mautic on kusanagi
#---------------------------------------
server {
listen 80;
server_name mautic.xxx.site ;
access_log /home/kusanagi/provision_name/log/nginx/access.log main;
error_log /home/kusanagi/provision_name/log/nginx/error.log warn;