Skip to content

Instantly share code, notes, and snippets.

@yosangwon
yosangwon / runjs.rb
Created July 29, 2020 09:46
invoke javascript codes inside ruby on macos to automate macOS features
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?
This file has been truncated, but you can view the full file.
@font-face {
font-family: "D2Coding Powerline";
font-style: normal;
font-weight: 400;
-module(third).
-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) ->
-module(first).
-export([double/1,mult/2,area/3,treble/1,square/1]).
mult(X,Y) ->
X*Y.
double(X) ->
mult(2,X).
area(A,B,C) ->

Keybase proof

I hereby claim:

  • I am devleoper on github.
  • I am devleoper (https://keybase.io/devleoper) on keybase.
  • I have a public key ASA-U9IRmalgtDkgxbLr1wZOsHeCRy9KPqJXBnXpsCE2IAo

To claim this, I am signing this object:

@yosangwon
yosangwon / ascii_decode.rb
Created September 10, 2015 04:43
"VBScript 악성코드 분석"에서 아스키 코드를 써놓은 코드를 원본 소스 코드로 변환하기.
# ASCII tokenized text decoder
#
# usage
# ruby ascii_decode.rb input output
File.open(ARGV[1], "w") do |outfile|
File.open(ARGV[0], "r") do |infile|
dzclover = ""
while line = infile.gets
### Keybase proof
I hereby claim:
* I am devleoper on github.
* I am devleoper (https://keybase.io/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:
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
yosangwon / solution.vbs
Created June 26, 2015 15:09
USB 악성 코드가 숨긴 파일과 폴더를 다시 복구하는 스크립트
' 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
yosangwon / _show.html.erb
Last active August 29, 2015 14:20
Partial Rendering Example
<div id="workca">
<strong><%= link_to work.owner, work.owner.name %></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><%= work.name %></h2>
<hr/>
</div>