Skip to content

Instantly share code, notes, and snippets.

@blueplanet
blueplanet / yokohamarb_7
Created April 9, 2011 11:27
yokohamarb第7回 ボウリングスコア計算
class Bol
def getPin(pins, index)
if index > pins.length - 1
0
elsif pins[index] == 'G'
0
elsif pins[index] == '/' || pins[index] == 'x'
getPin(pins, index + 1)
else
pins[index]
@blueplanet
blueplanet / syntax_highlighting.py
Created July 12, 2012 12:48 — forked from JeanMertz/syntax_highlighting.py
Ruby on Rails syntax highlight switcher for Sublime Text 2
import sublime, sublime_plugin
import os
class DetectFileTypeCommand(sublime_plugin.EventListener):
""" Detects current file type if the file's extension isn't conclusive """
""" Modified for Ruby on Rails and Sublime Text 2 """
""" Original pastie here: http://pastie.org/private/kz8gtts0cjcvkec0d4quqa """
def on_load(self, view):
filename = view.file_name()
gem("rspec-rails", :group => "test")
gem("guard-rspec', :group => "test")
remove_file public/index.html
generate("rspec", "install")
generate("guard", "init")
@blueplanet
blueplanet / sublimetext2.md
Created October 22, 2012 22:29
Octopress for Sublime Text 2

SublimeText 2 Pluginを作ってみた

自己紹介

  • 英語が下手なので、発音がおかしい場合、ごめんなさい

SublimeText2との出会い

作ったプラグイン

@blueplanet
blueplanet / sublimetext2.md
Created October 22, 2012 22:38
Octopress for Sublime Text 2

SublimeText 2 Pluginを作ってみた

自己紹介

  • 英語が下手なので、発音がおかしい場合、ごめんなさい

SublimeText2との出会い

作ったプラグイン

@blueplanet
blueplanet / gist:3935133
Created October 22, 2012 22:41
Markdown / HTML / WEB プレゼンテーションツールメモ

Markdown

HTML

  • shower 使い方分からない。ロシアの方
  • slides シンプルで使いやすい

WEB

  • prezi テキスト・画像などを簡単に入力する;ズームと回転のアニメーションが出来る
@blueplanet
blueplanet / rails_start.scpt
Created October 24, 2012 06:53 — forked from rapimo/rails_start.scpt
iterm2 AppleScript for my Rails Project
-- ~/Library/Application\ Support/iTerm/Scripts/setup_rails.scpt
-- Thanks to http://www.worldgoneweb.com/2011/iterm2-advanced-features/#comment-20560
-- http://www.iterm2.com/#/section/documentation/scripting
tell application "iTerm"
activate
set myterm to (make new terminal)
set cd_to_my_project_path to ("cd ~/Projekte/my_awesome_project")
-- you can altenativly tell the first terminal
tell the first terminal
launch session "Panes"
@blueplanet
blueplanet / template.rb
Last active October 13, 2015 17:28
MyRails3 Template
gem "haml-rails"
gem 'simple_form'
gem_group :development do
gem 'i18n_generators'
gem 'commands'
gem 'pry-rails'
gem 'hirb-unicode'
gem 'growl' # Mac OS only
# coding: utf-8
class AddCountCacheToPublications < ActiveRecord::Migration
def change
add_column :publications, :concerns_count, :integer, null: false, default: 0
add_column :publications, :publication_comments_count, :integer, null: false, default: 0
Publication.reset_column_information
Publication.all.each do |p|
Publication.update_counters p.id, concerns_count: p.concerns.count, publication_comments_count: p.publication_comments.count
end