Skip to content

Instantly share code, notes, and snippets.

View yoshiki's full-sized avatar

Yoshiki Kurihara yoshiki

View GitHub Profile
@nicwolff
nicwolff / init.lua
Last active February 8, 2021 00:00
Hammerspoon script to move/resize window under mouse cursor with modifier keys
function get_window_under_mouse()
-- Invoke `hs.application` because `hs.window.orderedWindows()` doesn't do it
-- and breaks itself
local _ = hs.application
local my_pos = hs.geometry.new(hs.mouse.getAbsolutePosition())
local my_screen = hs.mouse.getCurrentScreen()
return hs.fnutils.find(hs.window.orderedWindows(), function(w)
return my_screen == w:screen() and my_pos:inside(w:frame())
@matthewearl
matthewearl / smblevextract.py
Last active April 29, 2022 17:48
Super Mario Bros Level Extractor
#!/usr/bin/env python3
#
# Copyright (c) 2018 Matthew Earl
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@inamiy
inamiy / chat.css
Created September 9, 2014 02:40
HipChat v3.0 for Mac + Remove 'Show more'
/* Prevent font scaling when switching orientations */
html {
-webkit-text-size-adjust: none;
}
* {
margin: 0;
padding: 0;
word-wrap: break-word;
}
@cihancimen
cihancimen / string_contains_emoji
Created November 26, 2012 00:54
Check if an NSString contains an emoji character
- (BOOL)stringContainsEmoji:(NSString *)string {
__block BOOL returnValue = NO;
[string enumerateSubstringsInRange:NSMakeRange(0, [string length]) options:NSStringEnumerationByComposedCharacterSequences usingBlock:
^(NSString *substring, NSRange substringRange, NSRange enclosingRange, BOOL *stop) {
const unichar hs = [substring characterAtIndex:0];
// surrogate pair
if (0xd800 <= hs && hs <= 0xdbff) {
if (substring.length > 1) {
const unichar ls = [substring characterAtIndex:1];
@1wErt3r
1wErt3r / SMBDIS.ASM
Created November 9, 2012 22:27
A Comprehensive Super Mario Bros. Disassembly
;SMBDIS.ASM - A COMPREHENSIVE SUPER MARIO BROS. DISASSEMBLY
;by doppelganger (doppelheathen@gmail.com)
;This file is provided for your own use as-is. It will require the character rom data
;and an iNES file header to get it to work.
;There are so many people I have to thank for this, that taking all the credit for
;myself would be an unforgivable act of arrogance. Without their help this would
;probably not be possible. So I thank all the peeps in the nesdev scene whose insight into
;the 6502 and the NES helped me learn how it works (you guys know who you are, there's no
@hayajo
hayajo / changelog_en.md
Last active April 16, 2024 12:57
ChangeLog を支える英語

ChangeLog を支える英語

ChangeLog を書く際によく使われる英語をまとめました。

ほとんど引用です。

基本形

#!/usr/bin/env ruby
# coding: utf-8
CMD = "#{ENV['ANDROID_HOME']}/platform-tools/adb logcat -v process"
(TAG,PRIORITY) = (ARGV.first || '*:I').split(':')
Signal.trap(:INT) do
puts "\nさよなライオン"
exit 0
end
@Nemo157
Nemo157 / arm-eabi-gcc_on_osx.markdown
Created April 7, 2011 01:30
How I installed arm-eabi-gcc on Mac OS X 10.6 - MacBook Air

Install some needed libraries

brew install libmpc

Make the temp directory to build in

mkdir toolchain
cd toolchain

Get the required sources

@hirosof
hirosof / SHA.cpp
Created February 7, 2011 12:03
SHA1とHMAC-SHA1とSHA256とHMAC-SHA256をC++で実装
/*
---------------------------------
SHA1 と HMAC-SHA1 と SHA256 と HMAC-SHA256(Win32 API未使用)
作成者:Hiroaki Software
----------------------------------
-------------参考資料など-----------
1.Javaで作って学ぶ暗号技術 (森北出版)
2.暗号化アルゴリズムを実感しよう その2
http://www.geocities.co.jp/SiliconValley-Oakland/8878/lab18/lab18.html
3.フリーのsha1ハッシュ計算ツール
@tsupo
tsupo / hmac_sha256.c
Created May 15, 2009 12:21
HMAC-SHA256 written in C with OpenSSL 0.9.8k
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <openssl/x509.h>
#include <openssl/hmac.h>
void
hmac_sha256(
const unsigned char *text, /* pointer to data stream */