Skip to content

Instantly share code, notes, and snippets.

View cutmail's full-sized avatar
🏠
Working from home

Tatsuya Arai cutmail

🏠
Working from home
View GitHub Profile
@sugyan
sugyan / fizzbuzz.pl
Last active September 21, 2023 08:49
"^ "
=~ (
("(").("~"^"."^"^"^(""=="")."").("^"
^"="^(""=="").""^")").("^"^".").("="
^"~"^(""=="")."").("("^(""=="^").""^
"."^"^").("("^(""=="").""^"^"^")").(
(" ^( "
== "
") .
"" ^
@Seasons7
Seasons7 / CCGaussianBlurSprite.h
Created January 29, 2011 15:19
CCGaussianBlurSprite.h
//
// CCGaussianBlurSprite.h
// AWTextureFilter
//
// Created by Keisuke Hata on 11/01/19.
//
#import <Foundation/Foundation.h>
#import "AWTextureFilter.h"
#import "CCTexture2DMutable.h"
+ (BOOL) hasExt:(NSString *)ext {
NSURL *url = [NSURL fileURLWithPath:[NSString stringWithFormat:@"check.%@", ext]];
UIDocumentInteractionController *doc =
[UIDocumentInteractionController interactionControllerWithURL:url];
BOOL success = [doc presentOptionsMenuFromRect:CGRectZero inView:[UIApplication sharedApplication].keyWindow animated:NO];
if(success) [doc dismissMenuAnimated:NO];
return success;
}
@dawsontoth
dawsontoth / InfiniteScrollingTableView.js
Created February 3, 2011 22:49
Infinite loading table view for iOS and Android.
/**
* We're going to create an infinite loading table view. Whenever you get close to the bottom, we'll load more rows.
*/
var win = Ti.UI.createWindow({ backgroundColor: '#fff' });
var isAndroid = Ti.Platform.osname === 'android';
/**
* Create our UI elements.
*/
var table = Ti.UI.createTableView({ top: 0, right: 0, bottom: 0, left: 0 });
@ryanmcgrath
ryanmcgrath / twitter_streaming.js
Created February 18, 2011 08:02
Access the Twitter Streaming API with ease (Node.js).
var util = require('util'),
http = require('http'),
events = require('events');
var Twitter = function(opts) {
this.username = opts.username;
this.password = opts.password;
this.track = opts.track;
this.data = '';
};
@itoz
itoz / Android LiveWallpaper Template
Created March 5, 2011 10:36
[Android] LiveWallpaper Template (アンドロイドライブ壁紙テンプレート)
/**
*============================================================
* copyright(c) 2011 www.romatica.com
* @author itoz
* 2011/03/05
*============================================================
*/
package ****.****.*****;
import android.content.res.Resources;
@aharisu
aharisu / gist:857961
Created March 7, 2011 01:53
TabViewのタブを下側に持ってくる
<?xml version="1.0" encoding="utf-8"?>
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/tabhost"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<RelativeLayout
android:layout_width="fill_parent"
@rummelonp
rummelonp / oauth.yml
Created March 29, 2011 03:58
Userstreamからふぁぼられとかを監視とかしてGrowlとかするかもしれないRubyスクリプト
---
:consumer_key: consumer_key
:consumer_secret: consumer_secret
:oauth_token: oauth_token
:oauth_token_secret: oauth_token_secret
@novi
novi / test.m
Created May 28, 2011 16:34
CGRectIntegralの謎
-(void)testRect
{
CGRect r = CGRectMake(1.222, 1.3333, 1, 1.000);
NSLog(@"%@", NSStringFromCGRect(r));
NSLog(@"%@", NSStringFromCGRect(CGRectIntegral(r)));
NSLog(@"%@", NSStringFromCGRect(CGRectMake(floorf(r.origin.x), floorf(r.origin.y), floorf(r.size.width), floorf(r.size.height))));
NSLog(@"%@", NSStringFromCGRect(CGRectMake(ceilf(r.origin.x), ceilf(r.origin.y), ceilf(r.size.width), ceilf(r.size.height))));
STAssertTrue(CGRectEqualToRect(r, CGRectIntegral(r)), nil, nil);
}
@dandorman
dandorman / fabrication_feature_pool_spec.rb
Created August 9, 2011 23:00
FactoryGirl vs. Fabrication
require 'spec_helper'
describe FeaturePool do
it "creates a new instance given valid attributes" do
Fabricate :feature_pool
end
it "is not valid without a name" do
Fabricate.build(:feature_pool, :name => "").should_not be_valid
end