Skip to content

Instantly share code, notes, and snippets.

View 0x00000FF's full-sized avatar
🛰️
Si vis pacem, para bellum

Kangjun Heo 0x00000FF

🛰️
Si vis pacem, para bellum
View GitHub Profile
Matching IP Addresses (Sample Input 192.168.0.1, 14 Steps)
^(?:[0-9]{1,3}\.){3}[0-9]{1,3}$
Matching Email Addresses (Sample Input example@example.com, 12 Steps)
^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$
Matching URLs (Sample Input https://example.com/exmple?a=1&b=1&c=1, 14 Steps)
^(?:https?|ftp):\/\/[^\s\/$.?#].[^\s]*$
#pronamaChan {
position: fixed;
bottom: 45px;
right: 120px;
opacity: .7;
z-index: 10;
}
#pronamaChan i {
display: block;
@0x00000FF
0x00000FF / GPS_Serial_TimeSync.cs
Created October 30, 2021 05:34
Time Sync with Serial GPS Module
private void SyncGPSTime()
{
if (!privileged)
privileged = EnableTimesync();
var time = new SYSTEMTIME();
var GPSSerial = new SerialPort()
{
PortName = setting.ports.gps,
BaudRate = 9600,
@0x00000FF
0x00000FF / github_webhook.php
Created July 5, 2021 03:33
PHP webhook for github
<?php
// utility
function rrmdir($dir) {
if (is_dir($dir)) {
$objects = scandir($dir);
foreach ($objects as $object) {
if ($object != "." && $object != "..") {
if (filetype($dir."/".$object) == "dir") rrmdir($dir."/".$object); else unlink($dir."/".$object);
}
}
#include <stdio.h>
#include <stdlib.h>
#define ALLOC ((unsigned char*)malloc(56))
#define A(x) (x & 0x4)
#define M(x) (x & 0x2)
#define P(x) (x & 0x1)
#define PTR(x) ((void*)x)
#define CHUNK_PTR(x) ((allocated_chunk*)(x - 8))
#define FREE_CHUNK(x) ((freed_chunk*)(x))
@0x00000FF
0x00000FF / region_list.php
Last active September 26, 2023 03:09
옛날에 만들어 둔 지역 선택 API (PHP)
<?php
/*
* A simple PHP file for Region Select API
* By P.Knowledge (0x00000FF)
*
* Data source from Namuwiki, 2020/11/04
*/
header("content-type: application/json");
@0x00000FF
0x00000FF / browser-copy-block.html
Created September 14, 2020 18:00
Prevents printing, context menu, and copy and developer console
<style>
@media print { * { display: none } }
</style>
<script>
document.addEventListener("contextmenu", function (e) {
e.preventDefault();
});
document.addEventListener("mousedown", function (e) {
// CoreLoad.cs Ln 412から
private bool AreTheseClose(int cmp1, int cmp2)
{
return Math.Abs(cmp1 - cmp2) < 25;
}
// タイトルバーのドラッグ終了
private void TitleBar_MouseUp(object sender, MouseEventArgs e)
{
@0x00000FF
0x00000FF / Cleaner.cs
Last active May 23, 2019 06:05
Everytime Article Fetch/Delete Class
/*
* Article/Comment Deletion Agent for Everytime service
* Available for .NET Framework/Core
*
* Newtonsoft.Json Required for Json Deserialization
* Json Types for Deserialization is under the Cleaner class
*/
using System.Collections.Generic;
using System.Text;
using System;
using System.Net;
using System.Text;
using System.Windows.Forms;
namespace TrafficLight
{
public partial class TrafficLight : Form
{
int _status = 0;