Skip to content

Instantly share code, notes, and snippets.

View Muratam's full-sized avatar
🌱
ぺこっぱマスター!

むらため Muratam

🌱
ぺこっぱマスター!
View GitHub Profile
int main (){
int a = 0;
return a
}
@Muratam
Muratam / UIFocusController.cs
Last active February 21, 2022 08:28
UnityのUGUIのフォーカスをタブキーとかで変えられるようにするやつ
using UnityEngine;
using UnityEngine.UI;
using System.Linq;
using System;
using System.Collections.Generic;
using UnityEngine.EventSystems;
//UGUIにタブ移動機能を追加出来ます。
//深い理由が無ければ、Canvasにこのスクリプトを張り付けて下さい。
//子オブジェクトのHierarchyの上からの並び順で取得し、その順番通りで座標に因らずにタブキーでフォーカスを映すことが出来ます。
" Mode | 再割当無し | 再割当有
" Normal + Visual | noremap | map
" Cmdline + Insert | noremap! | map!
" Normal | nnoremap | nmap
" Visual | vnoremap | vmap
" Cmdline | cnoremap | cmap
" Insert | inoremap | imap
" Vimの機能で変更する | ユーザーが定義したキー割り当てに従う
"Normal : 通常時
"Cmdline: open とかコマンドの時
@Muratam
Muratam / ButtonTransparent.cpp
Last active September 30, 2015 13:19
cocosのui::Button で一つの画像を使って透過で押すのと押さないのを判断させるコード
//#include "ui/CocosGUI.h"
auto button = ui::Button::create(ButtonFileName, "");
button->addTouchEventListener([button](Ref* pSender, cocos2d::ui::Widget::TouchEventType type){
switch (type){
case ui::Widget::TouchEventType::BEGAN:
//Write Process
button->setOpacity(255);
break;
case ui::Widget::TouchEventType::ENDED:
case ui::Widget::TouchEventType::CANCELED:
#include <stdio.h>
int main (void){
printf ("HEllo World");
return 0;
}
@Muratam
Muratam / run_hs.bat
Created January 23, 2016 18:01
Run Haskell ,Ruby For VSCODE Runner
@echo off
if "%~dpnx1" equ "" goto :eof
cd "%~dp1"
setlocal
set tempfile=%date:~4%%time::=%
set tempfile=%tempfile:/=%
set tempfile=%tempfile:.=%
set tempfile=%tempfile: =%
ghc -o %tempfile%.exe --make "%~dpnx1"
%tempfile%.exe
import re,requests,random
def getById(id):
body = requests.get("https://nijie.info/view.php?id="+ str(id)).content.decode("utf-8")
found = re.findall(r'"(https://\S+?nijie_picture\S+?\.(?:jpg|png|jpeg))"',body)
if found : return re.sub(r'/small_light\(\S+\)',"",found[0])
else : return ""
def randomGet():
r = random.randint(1005,187600)
function show(x) { console.log(Automation.getDisplayString(x)) }
function showByApp(text) {
app = Application.currentApplication()
app.includeStandardAdditions = true
app.displayDialog(Automation.getDisplayString(text))
}
function getDockInfo() {
apps = Application("System Events").processes()
for (app of apps) {
if (app.name() != "Dock") continue
@Muratam
Muratam / private.xml
Created October 12, 2016 05:18
For Karabiner
<?xml version="1.0"?>
<root>
<vkopenurldef> <name>KeyCode::VK_OPEN_URL_MV.R</name>
<url type="shell"> <![CDATA[ osascript ~/.mv_window.js R]]> </url>
</vkopenurldef>
<vkopenurldef> <name>KeyCode::VK_OPEN_URL_MV.L</name>
<url type="shell"> <![CDATA[ osascript ~/.mv_window.js L]]> </url>
</vkopenurldef>
<vkopenurldef> <name>KeyCode::VK_OPEN_URL_MV.MAX</name>
<url type="shell"> <![CDATA[ osascript ~/.mv_window.js MAX]]> </url>
using UnityEngine;
[RequireComponent(typeof(Camera))]
public class MonoImageEffect : MonoBehaviour {
private Material m_Material;
[SerializeField] Material material;
protected virtual void OnRenderImage(RenderTexture source, RenderTexture destination) {
Graphics.Blit(source, destination, material);
}