Skip to content

Instantly share code, notes, and snippets.

Avatar
🥦
Create node.js app for developer

Yoshiyuki Hisamatsu hisasann

🥦
Create node.js app for developer
View GitHub Profile
View videoを画面いっぱいに広げるスタイル
#note-vignette {
position: absolute;
right: 0;
top: 0;
min-width: 100%;
min-height: 100%;
width: auto;
height: auto;
z-index: -100;
}
View MissionControllLeft.applescript
tell application "System Events"
key down control
keystroke (ASCII character 28)
key up control
end tell
View MissionControllRight.applescript
[applescript]
tell application "System Events"
key down control
keystroke (ASCII character 29)
key up control
end tell
[/applescript]
@hisasann
hisasann / ExportAssetBundles.cs
Created Apr 16, 2014
AssetBundle用のエディター拡張
View ExportAssetBundles.cs
// C# の例
// プロジェクト ウィンドウの選択されたオブジェクトからアセットバンドルを作成
// コンパイルした後は "Menu" -> "Assets" へ移動して選択肢から一つを選択して
// アセットバンドルをビルド
using UnityEngine;
using UnityEditor;
public class ExportAssetBundles
{
[
@hisasann
hisasann / arguments.callee.caller.js
Created Jul 4, 2014
呼び出し元の引数を破壊する
View arguments.callee.caller.js
function func1(b) {
func2();
console.log(b); // IEではfalse
}
function func2(fn) {
arguments.callee.caller.arguments[0] = false; // 破壊した!
}
func1(true);
@hisasann
hisasann / arguments.callee.js
Created Jul 4, 2014
thisがarguments.calleの作用で変化してしまう
View arguments.callee.js
var global = this;
(function (b) {
if (b) {
console.log(global === this, '1'); // true
arguments.callee();
return;
}
console.log(this[0]); // true
@hisasann
hisasann / getPageSize.js
Created Aug 21, 2014
IE6を含めた画面のサイズ、画面のスクロール領域を含むサイズの取得関数
View getPageSize.js
function getPageSize() {
var xScroll, yScroll;
if (window.innerHeight && window.scrollMaxY) {
xScroll = window.innerWidth + window.scrollMaxX;
yScroll = window.innerHeight + window.scrollMaxY;
} else if (document.body.scrollHeight > document.body.offsetHeight) { // all but Explorer Mac
xScroll = document.body.scrollWidth;
yScroll = document.body.scrollHeight;
} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
xScroll = document.body.offsetWidth;
View jQuery.ua.js
var ua = navigator.userAgent.toLowerCase();
$.ua = {
isWindows: /windows/.test(ua), // Windows
isMac: /macintosh/.test(ua), // Mac
isIE: /msie (\d+)/.test(ua), // IE
isIE6: /msie (\d+)/.test(ua) && RegExp.$1 == 6, // IE6
isIE7: /msie (\d+)/.test(ua) && RegExp.$1 == 7, // IE7
isLtIE9: /msie (\d+)/.test(ua) && RegExp.$1 < 9, // IE9未満
isFirefox: /firefox/.test(ua), // Firefox
isWebKit: /applewebkit/.test(ua), // WebKit
@hisasann
hisasann / DestroyObject.cs
Created Aug 29, 2014
GameObjectを破棄するときにMaterialも破棄するメソッド
View DestroyObject.cs
private void DestroyObject ()
{
foreach (Transform t in transform) {
Destroy (t.gameObject.renderer.material);
Destroy (t.gameObject);
}
Destroy (gameObject.renderer.material);
Destroy (gameObject);
}
@hisasann
hisasann / DetectLeaks.cs
Created Aug 29, 2014
Unityのメモリリークを調査するための可視化
View DetectLeaks.cs
using UnityEngine;
using System.Collections;
public class DetectLeaks : MonoBehaviour
{
void OnGUI ()
{
GUI.color = Color.black;
GUILayout.BeginArea (new Rect (10, 80, 400, 800));