Skip to content

Instantly share code, notes, and snippets.

View RyuaNerin's full-sized avatar
๐Ÿ 
Room-keeper

RyuaNerin RyuaNerin

๐Ÿ 
Room-keeper
View GitHub Profile
@RyuaNerin
RyuaNerin / Parse Cookie.cs
Last active April 5, 2016 23:39
Convert Set-Cookie header of WebResponse to CookieCollection https://ryuanerin.kr/post/2016-03-31-parse-cookie
static class NativeMethods
{
[DllImport("user32.dll")]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool PeekMessage(
[In] ref MSG lpMsg,
IntPtr hwnd,
uint wMsgFilterMin,
uint wMsgFilterMax,
uint wRemoveMsg);
@RyuaNerin
RyuaNerin / ShellHelper.cs
Last active April 3, 2016 20:39
ShellExtension ์—์„œ ํŒŒ์ผ ํ•˜๋‚˜๋‹น ์ธ์Šคํ„ด์Šค ํ•˜๋‚˜์”ฉ ์ƒ๊ธฐ์ž–์•„์š”? ๊ทธ๊ฑฐ ๋ฐ์ดํ„ฐ ํ•˜๋‚˜๋กœ ๋ชฐ์•„์ฃผ๋Š”๋†ˆ์ž„. https://ryuanerin.kr/post/2016-03-04-shell-helper
// BY RyuaNerin
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Threading;
public sealed class ShellHelper
{
private static readonly IntPtr CustomParam = new IntPtr(0x7A8E);
@RyuaNerin
RyuaNerin / InstanceHelper.cs
Last active March 30, 2016 21:34
๋‹จ์ผ ์ธ์Šคํ„ด์Šค ์ฒดํฌํ•˜๋Š”๊ฒŒ ๋„ˆ๋ฌด ๊ท€์ฐฎ์•„์„œ ๊ทธ๋ƒฅ ๋งŒ๋“ฌ. https://ryuanerin.kr/post/2016-03-04-instance-helper
// By RyuaNerin
using System;
using System.Runtime.InteropServices;
using System.Threading;
using System.Windows.Forms;
public sealed class InstanceHelper : IDisposable
{
private const uint CustomMsg = 0x7A8F;
[DllImport("gdi32.dll")]
[return: MarshalAs(UnmanagedType.Bool)]
internal static extern bool BitBlt(IntPtr hdc, int nX, int nY, int nW, int nH, IntPtr hSrc, int nXSrc, int nYSrc, uint dwRop);
public static bool GetImageFromControl(Control control, out Image image)
{
image = new Bitmap(control.ClientRectangle.Width, control.ClientRectangle.Height);
try
{
@RyuaNerin
RyuaNerin / EncodingFinder.cs
Last active February 17, 2016 23:36
ํŒŒ์ผ์ด๋‚˜ ๋ฐฐ์—ด์˜ ๋ฌธ์ž ์ธ์ฝ”๋”ฉ์„ ์ฐพ์•„์ฃผ๋Š” ํด๋ž˜์Šค http://blog.ryuanerin.kr/31
// RyuaNerin
// 2013-03-08
// 2016-02-18
using System.Collections.Generic;
using System.IO;
using System.Text;
namespace RyuaNerin
{
@RyuaNerin
RyuaNerin / nyancat.cs
Created February 17, 2016 23:08
์˜ˆ์—์—์—์—์ „์— ๋งŒ๋“ค์—ˆ๋˜๊ฑฐ
// RyuaNerin
// 2015-06-08
using System;
namespace nyancat
{
static class Program
{
static byte[][] data =
@RyuaNerin
RyuaNerin / EngHanConverter.cs
Last active April 28, 2022 00:40
ํ•œ์˜ํƒ€๋ณ€ํ™˜ ์˜ˆ) ํ•œ๊ธ€ <-> gksrmf https://ryuanerin.kr/post/2016-02-18-eng-kor
// RyuaNerin
// 2016-02-18
using System;
using System.Text;
namespace RyuaNerin
{
public class EngHanConverter
{
@RyuaNerin
RyuaNerin / UnmanagedMemory.cs
Last active April 5, 2016 23:41
๋น„๊ด€๋ฆฌ ๋ฉ”๋ชจ๋ฆฌ ๊ด€๋ฆฌ ํŽธํ•˜๊ฒŒ ํ•˜๋ ค๊ณ  ๋งŒ๋“  ํด๋ž˜์Šค https://ryuanerin.kr/post/2016-02-18-unmanaged-memory
// RyuaNerin
/* Usage
using ํ•ด์„œ ์‚ฌ์šฉํ•˜๋ฉด ์•Œ์•„์„œ ํ• ๋‹น/ํ•ด์ œ๋ฅผ ํ•ด์ค€๋‹ค
Reallocate ํ•ด์„œ ์žฌํ• ๋‹น ๊ฐ€๋Šฅ
IntPtr ์ธ์ž ์œ„์น˜์— ๋Œ€์‹  ์‚ฌ์šฉ๊ฐ€๋Šฅํ•จ.
using (var mem = new UnmanagedMemory(4))
{
var toMem = BitConverter.BitConverter.GetBytes(0xF5769972);
@RyuaNerin
RyuaNerin / filter_rt.js
Created December 16, 2015 06:12
์•„์ฆˆ๋ ˆ์•„์—์„œ ํ•œ ์‚ฌ๋žŒ์ด ํŠน์„ฑ ์‚ฌ๋žŒ ํŠธ์œ— ๊ณ„์† RT ํ•˜๋Š”๊ฑฐ ๋ฐฉ์ง€.
var myid = TwitterService.currentUser.screen_name;
var rtn = {};
var rtc = {};
TwitterService.addEventListener('preFilterProcessTimelineStatus', function(status)
{
if (status.user.screen_name == myid)
return false;
if (!status.retweeted)