Skip to content

Instantly share code, notes, and snippets.

@sng2c
sng2c / ilju.sh
Last active September 16, 2022 04:34
일주
#!/bin/bash
DAY=0
if [[ $4 == "음" ]]; then
DAY=1
fi
if [[ $4 == "윤" ]]; then
DAY=2
fi
@sng2c
sng2c / plantuml.py
Last active July 22, 2021 13:31
plantuml.ipynb
!pip install plantuml
import plantuml
from IPython.display import Image
_puml = plantuml.PlantUML('http://www.plantuml.com/plantuml/img/')
def puml(s):
return Image(_puml.processes(s))
@sng2c
sng2c / 0_BACKLASH_COMPENSATION_TODO.md
Last active June 3, 2020 07:47
백래시 보정 코드
  • M425 코드가 있을때 자동으로 반영되게?
  • G1 에서 E(압출길이)에 대한 보정도 필요한가? -> 필요시 백래시 이동코드를 추가하는 식으로 가야함.
  • G28 코드는 0,0 로 이동하는 것으로 처리
    • 1,1로 갔다가 0,0으로 가야 백래시에 대한 초기화가 확실할거 같다.
  • arc등은 polygon으로 변경하고, 해상도 옵션을 추가하는 것으로. (압출거리도 재계산)
@sng2c
sng2c / keybase.md
Last active June 14, 2019 18:29
keybase.md

Keybase proof

I hereby claim:

  • I am sng2c on github.
  • I am sng2c (https://keybase.io/sng2c) on keybase.
  • I have a public key ASBFeTfI8isjrcctdB9K9C8fz79yo9DY72_S0ss6lI2k7go

To claim this, I am signing this object:

@sng2c
sng2c / lang.pl
Last active December 27, 2018 15:00
간단한 사칙연산 언어 인터프리터
use Test::More;
use Data::Dump;
sub compile {
my @assm;
my $prg = shift;
my ( $func, @args ) = @{$prg};
foreach my $a (@args) {
if ( ref($a) ne 'ARRAY' ) {
push( @assm, [ "push", $a ] );
@sng2c
sng2c / readmore_selectable.php
Last active February 20, 2018 00:36
WordPress readmore_selectable Plugin for inserting AD
<?php
/*
Plugin Name: Read More Selectable
Plugin URI:
Description: Insert 'wp-read-more' class into span-tags that has 'more-?' id in content.
Version: 0.1
Author: sng2c
Author URI: https://github.com/sng2c
License: GPL2
*/
@sng2c
sng2c / st_mode_extractor.py
Last active February 8, 2018 00:22
SmartThings 모드 커스터마이징
#-*- coding: utf-8 -*-
import copy
# sensors = [('Day','Night'),('Home','Away'),('Somebody','Nobody')]
# https://www.planttext.com/plantuml/svg/ZPHD3e8m48NtSufUW0kuC9YuSCN60n0CH4s49bfZkBq537H-wwPf7lFWwvkXKBv2ympl_W4GTw5pnsQiJxxlwdDSBhuTWIckAFQkkbzlWUWxvuVbWMAQrCCdBjWoIOPZLYkVV6BUC-AVJ2s45hq8ioQ6bJGjnvoaMeXYZJ0XHSS77iX6AmIryNAJmZ19XeETaMURb02r45evMseGUuevfKxOsGhp2DAC6b55MRMeBPbdmdPbvfSL0RUfiH7cV5ieh_oJ_9CrdcGf8ADz6xSs_jeiswxCFBCYu3Rrro3C-Uk5yihTqR8kkw6D5_CN
sensors = [('Day','Night'),('Home','Away')]
# https://www.planttext.com/plantuml/svg/ut8eBaaiAYdDpU7Y0h9AKXLS4YlZFV9pKxbW30LTNJi5lypqZ188rqeXFm_2HrK2uZYM9rP2581Oo4Q2-N0b22CHEX16mfN0pGSh0BiAQYJ2FLn8JiFK0-IXAq2t5zcb23ak96MOldF1L80UGX3NEgJcfO025m00
modes_len = 2**len(sensors)
<!DOCTYPE html>
<html>
<head>
<title>S2V</title>
<style type="text/css">
#player {
width: 500px;
height: 500px;
background-color: #000000;
}
<?php
$pids = [];
for($i=0; $i<10; $i++){
$pid = pcntl_fork();
if( $pid == -1 ){
die('could not fork');
}
if( $pid ){ # 부모 : 자식 PID 누적
# try this!!
use Template::Reverse;
use Data::Dumper;
use utf8;
binmode(STDOUT,':utf8');
my $rev = Template::Reverse->new;
# generating patterns automatically!!
my $str1 = [split(/(\s)/,"안녕하세 저는 김현승 입니다.")];
my $str2 = [split(/(\s)/,"반갑습니다 저는 박연건 입니다.")];