Skip to content

Instantly share code, notes, and snippets.

View korrio's full-sized avatar
👽

kOrriO korrio

👽
  • Hal Finney Co.,Ltd.
  • mempool
  • X @korrio
View GitHub Profile
@korrio
korrio / ROOT.xml
Created May 22, 2024 10:51
tomcat9 issue
<?xml version="1.0" encoding="UTF-8"?>
<Context>
<!-- database configurations -->
<Parameter name="JDBC.driver" value="org.postgresql.Driver"/>
<Parameter name="JDBC.url" value="jdbc:postgresql://localhost:5432/hmdm"/>
<Parameter name="JDBC.username" value="postgres"/>
<Parameter name="JDBC.password" value="new_password"/>
<!-- This directory is used to as a base directory to store app data -->
<Parameter name="base.directory" value="/var/lib/tomcat9/work"/>
@korrio
korrio / tokenPriceApi.js
Created May 21, 2024 04:43 — forked from Linch1/tokenPriceApi.js
Retrive the price of any bsc token from it's address without using external service like poocoin/dextools
let pancakeSwapAbi = [
{"inputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"}],"name":"getAmountsOut","outputs":[{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"stateMutability":"view","type":"function"},
];
let tokenAbi = [
{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},
];
const Web3 = require('web3');
/*
Required Node.js
@korrio
korrio / GetDeviceProfile.java
Last active May 10, 2024 06:56
Android Management API v1
import com.google.api.client.googleapis.auth.oauth2.GoogleCredential;
import com.google.api.client.http.HttpTransport;
import com.google.api.client.http.javanet.NetHttpTransport;
import com.google.api.client.json.JsonFactory;
import com.google.api.client.json.jackson2.JacksonFactory;
import com.google.api.services.androidmanagement.AndroidManagement;
import com.google.api.services.androidmanagement.model.DevicePolicy;
import java.io.IOException;
import java.security.GeneralSecurityException;
@korrio
korrio / upload_slip_updated.js
Created January 12, 2024 23:14
upload_slip_updated.js
<script type="text/javascript">
$(function(){
function countdown() {
// Set the countdown date/time
var countDownDate = new Date().getTime() + 15 * 60 * 1000;
// Update the countdown every second
var countdownTimer = setInterval(function() {
// Get today's date/time
@korrio
korrio / upload_slip.js
Last active December 1, 2023 10:03
upload_slip.js
$(function(){
function decodeImageFromBase64(data, callback) {
// set callback
qrcode.callback = callback;
// Start decoding
qrcode.decode(data)
}
@korrio
korrio / dt.js
Created October 17, 2023 08:15
dt.js
function init($this) {
// For more options check out the Datatables Docs:
// https://datatables.net/extensions/buttons/
var buttons = ["copy", "print"];
// Basic options. For more options check out the Datatables Docs:
// https://datatables.net/manual/options
@korrio
korrio / datatables.js
Created October 17, 2023 07:53
datatables.js
'use strict';
var DatatableBasic = (function() {
// Variables
var $dtBasic = $('#datatable-basic');
var $dtBasic2 = $('#datatable-basic2');
let searchParams = new URLSearchParams(window.location.search)
@korrio
korrio / dashboardSlice.tsx
Last active October 4, 2023 03:32
dashboardSlice.tsx
import { createAsyncThunk, createSlice, Draft } from '@reduxjs/toolkit';
import { AppThunk, RootState } from '@/store/index';
import Http from '@/api/Http';
type DashboardState = {
title: string;
btc_pending: string;
btc_pending_usd: string;
capital: number;
your_income: string;
@korrio
korrio / dashboard.json
Created September 29, 2023 10:44
dashboard.json
{
"title": "Dashboard",
"balance": "0",
"referral_count": 0,
"contracts": [
{
"id": 138,
"user_id": 51,
"plan_id": 1,
"amount": 10,
@korrio
korrio / falsehoods-programming-time-list.md
Created September 17, 2023 23:06 — forked from timvisee/falsehoods-programming-time-list.md
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).