Skip to content

Instantly share code, notes, and snippets.

View hheinsoee's full-sized avatar
💻
poke me to code whenever.

Hein Soe hheinsoee

💻
poke me to code whenever.
View GitHub Profile
@hheinsoee
hheinsoee / sql_typeInterface.js
Last active October 27, 2024 09:37
SQL to TypeInterface
const fs = require('fs');
// Read the SQL file
const sql = fs.readFileSync('structure.sql', 'utf8');
// Helper function to map SQL types to TypeScript types
const mapSQLTypeToTSType = (sqlType) => {
if (/tinyint\(1\)/i.test(sqlType)) return 'boolean'; // Map tinyint(1) to boolean
if (/int|decimal|float|double/i.test(sqlType)) return 'number';
if (/varchar|text/i.test(sqlType)) return 'string';
function removeDuplicates(arr) {
return arr.filter((item,
index) => arr.indexOf(item) === index);
}
export const camelize = sentence => {
return sentence.replace(/(?:^\w|[A-Z]|\b\w|\s+)/g, function(
camelCaseMatch,
i
) {
if (+camelCaseMatch === 0) return "";
return i === 0
? camelCaseMatch.toLowerCase()
: camelCaseMatch.toUpperCase();
});
@hheinsoee
hheinsoee / simple.html
Last active August 16, 2023 08:52
Simple Table
<div id="simple"></div>
<script>
var userList = [
{
id: 6,
profile_image_url: "https://avatars.githubusercontent.com/u/35089574?v=4",
name: "Hein Soe",
age: 28,
rs: true,
create_time: "2023-08-14T06:18:52.000Z"
@hheinsoee
hheinsoee / wpApi.php
Last active December 30, 2024 14:46
Wordpress website တွေ အတွက် api ကို သေသပ်စွာ ပြင်ဆင်ထားပါသည်
<?php
function wp()
{
return "https://wordpresssite.com";//ကြိုက်တဲ့ wp website ကိုသုံးနိုင်ပါတယ်
}
$get = new Wp(wp());
if (isset($_GET['category'])) {
$result = $get->byCategory(
$_GET['category'],
array(
@hheinsoee
hheinsoee / wp_api_repeater.php
Last active November 23, 2024 17:36
WP Repeater
<?php
function wp()
{
return "https://example_domain.com";// wp website ကိုသုံးနိုင်ပါတယ်
}
$get = new Wp(wp());
if (isset($_GET['category'])) {
$result = $get->byCategory(
$_GET['category'],
array(