Skip to content

Instantly share code, notes, and snippets.

@tkawa
tkawa / application_helper.rb
Created March 26, 2014 11:12
Railsのビューヘルパー内でHamlを使う
module ApplicationHelper
def render_thumbsup_button(options)
options[:url] ||= thumbsup_path
options[:method] ||= :put
options[:count] ||= 0
# ローカル変数を渡したいときのみ locals が必要
render inline: <<-HAML.strip_heredoc, type: :haml, locals: options
.thumbsup
= form_tag url, method: method do
%button.btn.btn-xs
@maleeb
maleeb / fileservice.js
Last active October 16, 2016 01:03
AngularJS file service for ionic (org.apache.cordova.file)
//Filesystem (checkDir, createDir, checkFile, creatFile, removeFile, writeFile, readeFile)
.factory('FileService', function($q) {
return {
checkDir: function (dir) {
var deferred = $q.defer();
getFilesystem().then(
function(filesystem) {
filesystem.root.getDirectory(dir, {create: false},
@joker1007
joker1007 / ginzarb_21.md
Last active April 14, 2021 06:41
Ginza.rb 21回の発表資料。rails_adminのつらみとオススメgem達。

rails_adminのつらみとオススメGemについて

rails_adminのつらみ

カスタマイズできるようで出来ない

レコード件数が一定以上になると使えない機能

  • ダッシュボード
  • 何も考えずに各モデルをカウントするのでレコード件数増えるとえらいことになる。
@voluntas
voluntas / webrtc.rst
Last active January 13, 2025 22:40
WebRTC の未来
@voluntas
voluntas / webrtc.rst
Last active July 14, 2025 04:05
WebRTC コトハジメ