Skip to content

Instantly share code, notes, and snippets.

View laiso's full-sized avatar
☀️

laiso laiso

☀️
View GitHub Profile
@laiso
laiso / gist:1217214
Last active October 29, 2020 18:18
[日記] 厨2病フレーズだけで記述できるプログラミング言語 のイメージ
# 厨2病フレーズだけで記述できるプログラミング言語 のイメージ
何ッ ()
もしも それ が 真実 なの ならば———
これ は 大変なことになるぞ! (いや?)\
まぁ…… いい…
ククク…… 見せてもらおうじゃないか…… ←\
旋律 の 傀儡師 の 実力とやらを! # TODO なぜだ!? 動く!?
@laiso
laiso / a.js
Created September 22, 2011 18:21
var randnum = Math.floor( Math.random() * 5 );
var result = "";
switch(randnum){
case 0: result = "大吉"; break;
case 1: result = "末吉"; break;
case 2: result = "小吉"; break;
case 3: result = "凶"; break;
default: result = "しらん"; break;
}
// http://9leap.net/
// ゲーム数を数える
javascript:var count=0;$('.numOfGames').each(function(i, item){ count += eval(item.innerText)});alert(count);
#!/usr/bin/env php
<?php
function main($str=null){
if(!ctype_alpha($str)){
return;
}
$chars = str_split($str);
$chars = array_reverse($chars);
/** jquery.balloon.js(rev.11152011) http://file.urin.take-uma.net/jquery.balloon.js-Demo.html */
(function(a){function e(a,b,c){if(c.url){b.load(c.url,function(e,f,g){if(c.ajaxComplete)c.ajaxComplete(e,f,g);d(a,b,c)})}else{var e=c.contents||a.attr("title");if(e&&e!=b.html()){b.html(e);a.removeAttr("title")}}}function d(d,e,f){function n(a,b,c,d,e){var f=Math.round(d/1.7320508);b.inactive()["setBorder"+c.camel.pos.f](d)["setBorder"+c.camel.pos.c1](f)["setBorder"+c.camel.pos.c2](f)["set"+c.camel.pos.p1](c.isTopLeft?-d:a.inner[c.size.p])["set"+c.camel.pos.c1](a.inner[c.size.c]/2-f).active().$.css("border-"+c.pos.f+"-color",e)}var g,h,i={position:"absolute",height:"0",width:"0",border:"solid 0 transparent"},j=new c(d),k=new c(e);k.setTop(-f.offsetY+(f.position&&f.position.indexOf("top")>=0?j.top-k.height:f.position&&f.position.indexOf("bottom")>=0?j.bottom:j.center.top-k.height/2));k.setLeft(f.offsetX+(f.position&&f.position.indexOf("left")>=0?j.left-k.width:f.position&&f.position.indexOf("right")>=0?j.right:j.ce
@laiso
laiso / builder.py.diff
Created November 25, 2011 08:00
Titanium Mobile SDK 1.7.5のiOS ビルドでDefault.png をコピーできなくてxcodebuild がコケる場合のパッチ
diff --git a/Titanium/mobilesdk/osx/1.7.5/iphone/builder.py b/Titanium/mobilesdk/osx/1.7.5/iphone/builder.py
index f1476f3..37cf938 100755
--- a/builder.py
+++ b/builder.py
@@ -1086,7 +1086,7 @@ def main(args):
if not os.path.exists(defaultpng_path):
defaultpng_path = os.path.join(project_dir,'Resources','Default.png')
if os.path.exists(defaultpng_path):
- shutil.copy(defaultpng_path,app_dir)
+ shutil.copy(defaultpng_path,iphone_resources_dir)
@laiso
laiso / analytics.xml
Created November 30, 2011 16:48
analytics.xml
<?xml version="1.0" encoding="UTF-8"?>
<Module>
<ModulePrefs title="Google Analytics for g:iphone-dev:id:laiso">
<Require feature="analytics"/>
</ModulePrefs>
<Content type="html"><![CDATA[
<script>_IG_Analytics("UA-2739452-1", "/laiso");</script>]]>
</Content>
</Module>
diff --git a/CHCSVParser.h b/CHCSVParser.h
index 6a7a198..93a52a7 100644
--- a/CHCSVParser.h
+++ b/CHCSVParser.h
@@ -55,7 +55,7 @@
NSError *error;
}
-@property (assign) __weak id<CHCSVParserDelegate> parserDelegate;
+@property (weak) id<CHCSVParserDelegate> parserDelegate;
###
* @title Google 検索の結果にtwitter上で何個言及されているかを表示するブックマークレット
* @description http://d.hatena.ne.jp/laiso/20111204/p1
* @include http://*.google.*\/search
* @licence MIT
* @require jQuery
###
_STYLE = """
padding: 0 0.5em;
<?php
/**
* Exite翻訳(英語→日本語)の野良API サンプル
*/
$text = 'This is a pen.';
$to = 'ENJA'; // ENJA or JAEN
$q = http_build_query(array(
'_id' => '6855579bdcb52e1a0a3822af4b5a9c88',