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 / sublime-syntax.rb
Created Dec 2, 2019
Try parse sublime-syntax
View sublime-syntax.rb
require 'psych'
module Sublime
class Syntax
class Context
META_PATTERNS = %w(
meta_scope
meta_content_scope
meta_include_prototype
clear_scopes
@hyrious
hyrious / ClangFormat.py
Created Nov 25, 2019
use clang format in sublime text
View ClangFormat.py
# refer to
# clang-format-sublime: https://github.com/llvm-mirror/clang/blob/master/tools/clang-format/clang-format-sublime.py
# diff-match-patch: https://github.com/google/diff-match-patch
import os
from subprocess import Popen, PIPE, STARTUPINFO, STARTF_USESHOWWINDOW
from sublime import *
from sublime_plugin import *
from sublime_lib import *
from .diff_match_patch import *
@hyrious
hyrious / restore-desktop-ini.md
Created Oct 20, 2019
restore desktop.ini if some guy messed them up
View restore-desktop-ini.md

Take %UserProfile%\Desktop\desktop.ini for example.

  1. Create a desktop.ini file with content below and saved in UTF-16 LE with BOM. Hopefully notepad.exe has such choice to use the right encoding.
[.ShellClassInfo]
LocalizedResourceName=@%SystemRoot%\system32\shell32.dll,-21769
IconResource=%SystemRoot%\system32\imageres.dll,-183
@hyrious
hyrious / pull-stars.rb
Last active Nov 29, 2019
Pull GitHub Stars
View pull-stars.rb
#!/usr/bin/env ruby -wKU
require 'io/console'
require 'ostruct'
require 'http'
def h2o h
JSON.parse(JSON.generate(h), object_class: OpenStruct)
end
@hyrious
hyrious / outline-filter-example.js
Created Sep 19, 2019
rmmv OutlineFilter, using webgl
View outline-filter-example.js
var angleStep = (Math.PI * 2 / 10).toFixed(7);
var vert = `attribute vec2 aVertexPosition;
attribute vec2 aTextureCoord;
uniform mat3 projectionMatrix;
varying vec2 vTextureCoord;
void main(void)
{
View nfa2dfa.c
// </> convert NFA to DFA
// @hyrious
//
// input:
// n m i1 i2 .. _ <- this '_' is reserved
// s1 m1 m2 .. m_
// ...
// sn m1 m2 .. m_
//
// example:
@hyrious
hyrious / json.rb
Last active Sep 3, 2019
json.rb for rgss?
View json.rb
# coding: utf-8
# pure ruby json implementation
module JSON
def self.parse json
ret = nil
json.slice!(/^\s+/)
case
when json.slice!(/^null/)
ret = nil
@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
You can’t perform that action at this time.