This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source 'https://rubygems.org' | |
gem 'rake' | |
gem 'motion-cocoapods' | |
gem "bubble-wrap", :require => "bubble-wrap/all" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
query = BW::HTTP.get("http://example.com") | |
@connection = query.connection | |
unless @connection.nil? | |
# これ! | |
@connection.cancel() | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'nokogiri' | |
require 'fileutils' | |
require 'date' | |
# usage: ruby import.rb my-blog.xml | |
# my-blog.xml is a file from Settings -> Basic -> Export in blogger. | |
data = File.read ARGV[0] | |
doc = Nokogiri::XML(data) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source "https://rubygems.org" | |
gem "bubble-wrap", :require => "bubble-wrap/all" | |
gem "motion-testflight" | |
#gem "cocoapods", "0.16.4" | |
#gem "cocoapods", "0.17.1" | |
gem "cocoapods" | |
#gem "motion-cocoapods" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
class InformView < UIView | |
attr_accessor :message | |
def init() | |
if super | |
width = 280 | |
height = 100 | |
x = (App.window.frame.size.width - width) / 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# method define | |
["Favorite", "Archive"].each do |name| | |
define_method("toggle#{name}") do |bookmark, &block| | |
key = name.downcase | |
value = bookmark[key] # boolean | |
# make parameter | |
if value | |
v = "0" | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# TODO: meta | |
def toggleFavorite(bookmark, &block) | |
favorite = bookmark[:favorite] | |
if favorite | |
f = "0" | |
else | |
f = "1" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
class InformView < UIView | |
WIDTH = 280 | |
HEIGHT = 100 | |
# singleton | |
def self.instance() | |
# Dispatch.once を使うとinitメソッドのsuperで以下のwaningがでました。どぼちて? | |
# > unknown: warning: passing a block to an Objective-C method - will be ignored |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# show view | |
InformView.show("loading..", target:navigationController.view, animated:true) | |
# hide view | |
InformView.hide(true) |
NewerOlder