Skip to content

Instantly share code, notes, and snippets.

@ecpplus
ecpplus / FBMissingSymbols.m
Last active August 29, 2015 14:05
Missing FB symbols required by Parse SDK
NSString *FBTokenInformationExpirationDateKey = @"";
NSString *FBTokenInformationTokenKey = @"";
NSString *FBTokenInformationUserFBIDKey = @"";
@interface FBAppCall:NSObject
@end
@implementation FBAppCall
@end
@interface FBRequest:NSObject
@end
@implementation FBRequest
@ecpplus
ecpplus / gist:713124
Created November 24, 2010 04:42
Cocos2d(0.99.4) - CCRepeatForever having interval.
id delaying = [CCDelayTime actionWithDuration:1.5f]; // duration is second, not millsecond.
id sequence = [CCSequence actions:someAction, delaying, nil];
CCRepeatForever *repeatAction = [CCRepeatForever actionWithAction:sequence];
[aSprite runAction:repeatAction];
@ecpplus
ecpplus / gist:713131
Created November 24, 2010 04:51
Cocos2d(0.99.4) create animation by CCSpriteSheet
CCSpriteSheet *animationSheet = [CCSpriteSheet spriteSheetWithFile:@"animation_sheet.png"];
[self addChild:animationSheet];
CCSprite *animationSprite = [CCSprite spriteWithTexture:animationSheet.texture
rect:CGRectMake(0, 0, 256, 290)];
animationSprite.position = ccp(self.contentSize.width / 2, self.contentSize.height / 2);
[animationSheet addChild:animationSprite];
CCAnimation *animation = [CCAnimation animationWithName:@"an_animation" delay:0.04f];
@ecpplus
ecpplus / gist:861577
Created March 9, 2011 02:30
will_paginateで出力されるページネーションの日本語化
# -*- coding:utf-8 -*-
# will_paginateで出力されるページネーションの日本語化
WillPaginate::ViewHelpers.pagination_options = {
:class => 'pagination',
:previous_label => '«前へ',
:next_label => '次へ»',
:inner_window => 4, # links around the current page
:outer_window => 1, # links around beginning and end
:separator => ' ', # single space is friendly to spiders and non-graphic browsers
:param_name => :page,
@ecpplus
ecpplus / gist:1122324
Created August 3, 2011 10:13
Google+ button doesn't work on IE
<!-- this doesn't work on IE (Google default) -->
<g:plusone size="medium"></g:plusone>
<!-- this works -->
<div class="g-plusone" data-size="small" data-count="true"></div>
<!-- without plus count -->
<div class="g-plusone" data-size="small" data-count="false"></div>
@ecpplus
ecpplus / Rakefile
Created August 3, 2011 09:52
uninitialized constant Rake::DSL error
require File.expand_path('../config/application', __FILE__)
require 'rake/dsl_definition' # add this
require 'rake'
@ecpplus
ecpplus / new.html.erb
Created September 13, 2011 17:39
Railsでファイルアップロードするとき
<%= form_for :user, :url => {:action => :create}, :html => {:method => :post, :multipart => true} do |f| %>
<%= f.text_filed :name %>
<%= f.file_filed :image %>
<% end %>
@ecpplus
ecpplus / Gemfile
Created September 13, 2011 17:47
Rails3.0.x to Rails3.1.0
gem 'rails', '3.1.0'
...
# add for assets
gem 'sass'
gem 'coffee-script'
gem 'uglifier'
gem 'jquery-rails'
@ecpplus
ecpplus / Gemfile
Created September 14, 2011 07:52
[Rails] fix `autodetect': Could not find a JavaScript runtime. error
gem 'therubyracer' # add this
@ecpplus
ecpplus / ViewController.m
Created November 21, 2011 15:02
UIWebView を最後までスクロールしても背景が見えなようにする
for (id subview in webView.subviews)
if ([[subview class] isSubclassOfClass: [UIScrollView class]])
((UIScrollView *)subview).bounces = NO;
// http://blog.imho.jp/2011/05/uiwebview_24.html
// It works!