Skip to content

Instantly share code, notes, and snippets.

🏃
keeping fit

hyrious hyrious

🏃
keeping fit
Block or report user

Report or block hyrious

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@hyrious
hyrious / api.rb
Last active Aug 19, 2019
RGSS WebP
View api.rb
# coding: utf-8
# this file provides a handy way to call win32api
class Dll
def initialize dll
@dll = dll.to_s
end
def method_missing func, *args
imports = args.map { |e| Integer === e ? 'L' : 'p' }
View 直角引号.sublime-keymap
[
{
"keys": [""],
"command": "insert_snippet",
"args": {
"contents": "「$0」"
},
"context": [
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
@hyrious
hyrious / mainloop.rb
Created Jul 23, 2019
hack your mainloop in Midori.rb
View mainloop.rb
# require 'midori.rb'
$mainloop = nil
def mainloop &blk
$mainloop = blk
end
class << EventLoop
alias _timer_once_mainloop timer_once
@hyrious
hyrious / maybe.rb
Created Jul 23, 2019
not that Maybe
View maybe.rb
class Maybe
attr_reader :obj
def initialize obj, chain=obj.inspect, max_depth=2
@obj = obj
@chain = chain
@max_depth = max_depth
end
def method_missing(meth, *args, &blk)
return self if @obj.nil? and @max_depth == 0
View 直角引号.sublime-snippet
<snippet>
<content><![CDATA[「$0」]]></content>
<tabTrigger>【</tabTrigger>
<description>「」</description>
<!-- <scope>source.*</scope> -->
</snippet>
@hyrious
hyrious / main.rb
Created Jul 8, 2019
Sample RGSS Console Using MailSlot
View main.rb
# coding: utf-8
Font.default_name = ['等距更纱黑体 SC', '等线', 'SimHei']
class Module
public :include
end
if defined? Graphics.background_exec
Graphics.background_exec = true
@hyrious
hyrious / mailslot_example.c
Created Jul 7, 2019
Windows IPC -- MailSlot
View mailslot_example.c
#include <windows.h>
#include <stdio.h>
HANDLE hSlot;
LPTSTR Slot = TEXT("\\\\.\\mailslot\\meow");
BOOL WINAPI MakeSlot(LPTSTR lpszSlotName) {
hSlot = CreateMailslot(lpszSlotName, 0, MAILSLOT_WAIT_FOREVER, 0);
if (hSlot == INVALID_HANDLE_VALUE) {
View isare.rb
# coding: utf-8
Types = {}
Objects = {}
def enum part
part.split(/, | and /)
end
def scan part, type
View SteamAPI_ISteamApps_GetCurrentGameLanguage.rb
x = SteamAPIContext.new
a = Win32API.new('steam_api', 'SteamAPI_ISteamApps_GetCurrentGameLanguage', 'L', 'L')
l = Win32API.new('kernel32', 'lstrlen', 'L', 'L')
ps = a.call(x.steam_apps)
len = l.call(ps)
str = [].pack("x#{len}")
mm = Win32API.new('kernel32', 'RtlMoveMemory', 'pLL', 'L')
mm.call(str, ps, len)
p str
View arknights_log.c
#include <time.h>
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
void cls( HANDLE hConsole ) {
COORD coordScreen = { 0, 0 };
DWORD cCharsWritten;
CONSOLE_SCREEN_BUFFER_INFO csbi;
DWORD dwConSize;
You can’t perform that action at this time.