Skip to content

Instantly share code, notes, and snippets.


Yi Sangwon yosangwon

View GitHub Profile
yosangwon / runjs.rb
Created Jul 29, 2020
invoke javascript codes inside ruby on macos to automate macOS features
View runjs.rb
require 'open3'
require 'shellwords'
require 'json'
def runjs(script)
command = ['osascript', '-ss', '-l', 'JavaScript']
script.split(/\n/).each { |l| command.concat ['-e', l] }
output, status = Open3.capture2(command.shelljoin)
raise "osascript didn't run successfully!" unless status.success?
View d2coding.css
This file has been truncated, but you can view the full file.
@font-face {
font-family: "D2Coding Powerline";
font-style: normal;
font-weight: 400;
View third.erl
-export([x0r1/2, x0r2/2, x0r3/2, maxThree/3, howManyEqual/3]).
x0r1(A,B) ->
A =/= B.
x0r2(A,B) ->
not (A == B).
x0r3(A,B) ->
View first.erl
mult(X,Y) ->
double(X) ->
area(A,B,C) ->

Keybase proof

I hereby claim:

  • I am devleoper on github.
  • I am devleoper ( on keybase.
  • I have a public key ASA-U9IRmalgtDkgxbLr1wZOsHeCRy9KPqJXBnXpsCE2IAo

To claim this, I am signing this object:

yosangwon / ascii_decode.rb
Created Sep 10, 2015
"VBScript 악성코드 분석"에서 아스키 코드를 써놓은 코드를 원본 소스 코드로 변환하기.
View ascii_decode.rb
# ASCII tokenized text decoder
# usage
# ruby ascii_decode.rb input output[1], "w") do |outfile|[0], "r") do |infile|
dzclover = ""
while line = infile.gets
View gist:29c25bf42e4bcd9e2192
### Keybase proof
I hereby claim:
* I am devleoper on github.
* I am devleoper ( on keybase.
* I have a public key whose fingerprint is CCEA CDD0 3E6B 91EA 265E B77A 06B8 3953 B65D A83E
To claim this, I am signing this object:
View 15-7-7.cpp
template <typename type, typename std_type = std::allocator<type>>std::list<type, std_type> operator+(std::list<type, std_type> * operand, std::list<type> * operanded)
std::list<type> * list = new std::list<type>;
list.assign(operand.begin(), operand.end());
for_each(operanded.begin(), operanded.end(), [&list](type element)->void{ list.push_back(element); });
return list;
yosangwon / solution.vbs
Created Jun 26, 2015
USB 악성 코드가 숨긴 파일과 폴더를 다시 복구하는 스크립트
View solution.vbs
' USB 악성코드 뒤처리
' by @devleoper in @HYU-ICEWALL
dim filesystemobj
set filesystemobj = createobject("scripting.filesystemobject")
for each drive in filesystemobj.drives
if drive.isready = true then
if drive.freespace > 0 then
if drive.drivetype = 1 then
yosangwon / _show.html.erb
Last active Aug 29, 2015
Partial Rendering Example
View _show.html.erb
<div id="workca">
<strong><%= link_to work.owner, %></strong>
<%= link_to "#{time_ago_in_words(work.created_at)} ago", work %>
<%= link_to 'Edit', edit_work_path(work) %>
<%= link_to 'Destroy', work, method: :delete, data: { confirm: 'Are you sure?' } %><br/>
<h2><%= %></h2>