Skip to content

Instantly share code, notes, and snippets.

View ariakm25's full-sized avatar
:electron:
undefined

Aria ariakm25

:electron:
undefined
View GitHub Profile
@ariakm25
ariakm25 / jikan-client-wp.js
Last active August 1, 2024 17:30
Jikan.me client for wordpress (meta-box)
let $ = jQuery;
$('#meta_mal_api_button').click(function () {
let id = $('#meta_mal_api_input').val();
$('#meta_mal_api_input').val('Processing').attr("disabled", 'disabled');
fetch('https://api.jikan.moe/v3/anime/' + id)
.then(res => res.json())
.then(res => {
$('#title').val(res.title);
$('#ak_synonyms').val(res.title_synonyms.join(", "));

Keybase proof

I hereby claim:

  • I am ariakm25 on github.

  • I am ariakm25 (https://keybase.io/ariakm25) on keybase.

  • I have a public key ASDtgAO8mWPJw0qn41cH-U1JGDF__PXMnY2Al8tHQ4LVEQo

@ariakm25
ariakm25 / Ajax Search.html
Last active July 28, 2019 11:49
Ajax Search with XHR
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>XHR Search</title>
</head>
@ariakm25
ariakm25 / siemasu.js
Last active July 24, 2019 16:42
siema.js fix drag
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("Siema",[],t):"object"==typeof exports?exports.Siema=t():e.Siema=t()}(this,function(){return function(e){function t(s){if(i[s])return i[s].exports;var n=i[s]={i:s,l:!1,exports:{}};return e[s].call(n.exports,n,n.exports,t),n.l=!0,n.exports}var i={};return t.m=e,t.c=i,t.d=function(e,i,s){t.o(e,i)||Object.defineProperty(e,i,{configurable:!1,enumerable:!0,get:s})},t.n=function(e){var i=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(i,"a",i),i},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,i){"use strict";function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Sym
@ariakm25
ariakm25 / wp_bootstrap_paginate.php
Created April 18, 2019 02:29
Custom page navigation bootstrap for wordpress
//Pagination
function bs_pagination( \WP_Query $wp_query = null, $echo = true ) {
if ( null === $wp_query ) {
global $wp_query;
}
$pages = paginate_links( [
'base' => str_replace( 999999999, '%#%', esc_url( get_pagenum_link( 999999999 ) ) ),
'format' => '?paged=%#%',
'current' => max( 1, get_query_var( 'paged' ) ),
'total' => $wp_query->max_num_pages,
<?php
//Fungsi untuk merubah format bytes
function filesize_formatted($file)
{
$bytes = $file;
if ($bytes >= 1073741824) {
return number_format($bytes / 1073741824, 2) . ' GB';
} elseif ($bytes >= 1048576) {
return number_format($bytes / 1048576, 2) . ' MB';
@ariakm25
ariakm25 / darkmode.js
Last active December 21, 2019 05:21
Toggle Dark Mode
// Check Dark Mode activated in Local Storage
localStorage.getItem('darkmode','dark') ? $('#darkmode').prop('checked', true) : '' ;
$('#darkmode').is(':checked') ? $('body').addClass('dark') : $('body').removeClass('dark')
$('#darkmode').on('click', function(){
$('#darkmode').is(':checked') ? $('body').addClass('dark') : $('body').removeClass('dark')
})
//Dark Mode Trigger
@ariakm25
ariakm25 / CookiesBookmark
Created February 16, 2019 10:40
JQuery JS Cookie
/**
* Cookies WATCHLIST
* js.cookie.js
**/
// cek cookies favorites
if (typeof Cookies.get('favorites') === 'undefined') {
Cookies.set('favorites',[])
}