Skip to content

Instantly share code, notes, and snippets.

View deiga's full-sized avatar

Timo Sand deiga

View GitHub Profile
@deiga
deiga / Kaminari ajax pager
Created January 26, 2013 17:00 — forked from rguggemos/Kaminari ajax pager
Kaminari ajax pager
If you switch to kaminari,
http://railscasts.com/episodes/254-pagination-with-kaminari
...the lines added to application.js become redundant when you implement the pager like in this demo project:
https://github.com/amatsuda/kaminari_example/tree/ajax
in index.html:
@deiga
deiga / i18n.rb
Created January 31, 2013 13:00
Debug i18n in rails 3
# config/initializers/i18n.rb
# add newer versions to this array if the method definition didn't change, otherwise do an if-cascade
if ['0.6.1'].include?(I18n::VERSION)
module I18n
module Backend
class Simple
# Monkey-patch-in localization debugging.. ( see: http://www.unixgods.org/~tilo/Rails/which_l10n_strings_is_rails_trying_to_lookup.html )
# Enable with ENV['I18N_DEBUG']=1 on the command line in server startup, or ./config/environments/*.rb file.
#
@deiga
deiga / sublime-xiki-error.xiki
Created February 14, 2013 23:46
SublimeXiki error
docs
/Users/timosand/.rvm/rubies/ruby-1.9.3-p374/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find xiki (>= 0) amongst [bundler-1.2.3, gem-ctags-1.0.5, rake-10.0.3, rubygems-update-1.8.25, rvm-1.11.3.6] (Gem::LoadError)
from /Users/timosand/.rvm/rubies/ruby-1.9.3-p374/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec'
from /Users/timosand/.rvm/rubies/ruby-1.9.3-p374/lib/ruby/site_ruby/1.9.1/rubygems.rb:1231:in `gem'
from /Users/timosand/.rvm/gems/ruby-1.9.3-p374@global/bin/xiki:18:in `<main>'
from /Users/timosand/.rvm/gems/ruby-1.9.3-p374@global/bin/ruby_noexec_wrapper:14:in `eval'
from /Users/timosand/.rvm/gems/ruby-1.9.3-p374@global/bin/ruby_noexec_wrapper:14:in `<main>'
$ pwd
/Users/timosand/Dropbox/Sublime Text 2/Packages
@deiga
deiga / gist:5019873
Created February 23, 2013 14:01
Quicksilver hang after OpenMeta plugin update
Date/Time: 2013-02-23 13:58:34 +0000
OS Version: 10.8.2 (Build 12C60)
Architecture: x86_64
Report Version: 11
Command: Quicksilver
Path: /Applications/Quicksilver.app/Contents/MacOS/Quicksilver
Version: ß71 (3942)
Parent: launchd [1]
@deiga
deiga / git-add-upstream
Last active December 14, 2015 03:19
Script to add upstream to current repo
#! /usr/bin/env ruby
require 'open-uri'
require 'json'
origin_url = `git remote show origin | awk '/Fetch/ {print $3}'`
origin_url.tr!("\n",'')
repo_name = origin_url.gsub('github.com','').gsub(/http[s]:\/\//, '').gsub('.git','')
repo_parts = repo_name.split('/').reject!(&:empty?)
url = "https://api.github.com/repos/#{repo_parts[0]}/#{repo_parts[1]}"
result = JSON.parse(open(url).read)
parent = result['parent']
@deiga
deiga / make.log
Created February 25, 2013 22:44
rvm install 2.0.0 -C --shared
CC = gcc-4.2
LD = ld
LDSHARED = gcc-4.2 -dynamiclib
CFLAGS = -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Werror=pointer-arith -Werror=write-strings -Werror=declaration-after-statement -Werror=shorten-64-to-32 -Werror=implicit-function-declaration -fno-common -pipe
XCFLAGS = -include ruby/config.h -include ruby/missing.h -D_FORTIFY_SOURCE=2 -fstack-protector -fno-strict-overflow -fvisibility=hidden -DRUBY_EXPORT
CPPFLAGS = -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -I/usr/local/opt/libyaml/include -I/usr/local/opt/readline/include -I/usr/local/opt/libxml2/include -I/usr/local/opt/libxslt/include -I/usr/local/opt/libksba/include -I/usr/local/opt/openssl/include -I/usr/local/opt/curl-ca-bundle/include -I/usr/local/opt/sqlite/include -I. -I.ext/include/x86_64-darwin12.2.0 -I./include -I.
DLDFLAGS = -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,suppress -L/us
@deiga
deiga / configure.log
Created February 26, 2013 09:22
rvm install ruby-2.0.0 --rubygems head --debug
[2013-02-26 09:15:52] ./configure
current path: /Users/timosand/.rvm/src/ruby-2.0.0-p0
command(6): ./configure --prefix=/Users/timosand/.rvm/rubies/ruby-2.0.0-p0 --with-opt-dir=/usr/local/opt/libyaml:/usr/local/opt/readline:/usr/local/opt/libxml2:/usr/local/opt/libxslt:/usr/local/opt/libksba:/usr/local/opt/openssl:/usr/local/opt/sqlite --with-gcc=gcc-4.2 --disable-install-doc --enable-shared
checking build system type... x86_64-apple-darwin12.2.0
checking host system type... x86_64-apple-darwin12.2.0
checking target system type... x86_64-apple-darwin12.2.0
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
@deiga
deiga / gist:5091395
Created March 5, 2013 16:07
rails_admin error log
NoMethodError - undefined method `rails_admin_default_object_label_method' for #<Hash:0x007fb59db6f9e0>:
(gem) rails_admin-0.4.5/lib/rails_admin/config/fields/association.rb:23:in `block (2 levels) in <class:Association>'
(gem) rails_admin-0.4.5/lib/rails_admin/config/fields/association.rb:20:in `block in <class:Association>'
(gem) rails_admin-0.4.5/lib/rails_admin/config/configurable.rb:68:in `block in register_instance_option'
(gem) rails_admin-0.4.5/lib/rails_admin/config/proxyable/proxy.rb:31:in `method_missing'
(gem) rails_admin-0.4.5/app/views/rails_admin/main/index.html.haml:128:in `block (3 levels) in ___sers_timosand__rvm_gems_ruby_______p__roydon_gems_rails_admin_______app_views_rails_admin_main_index_html_haml__4607688845455230579_70209006925140'
(gem) rails_admin-0.4.5/app/views/rails_admin/main/index.html.haml:127:in `block (2 levels) in ___sers_timosand__rvm_gems_ruby_______p__roydon_gems_rails_admin_______app_views_rails_admin_main_index_html_haml__4607688845455230579_70209006925140
@deiga
deiga / error_gist.md
Created March 9, 2013 12:46
gtk+ uprade fails on 10.8.2

brew doctor

Warning: /Library/Frameworks/Mono.framework detected
This can be picked up by CMake's build system and likely cause the build to
fail. You may need to move this file out of the way to compile CMake.
Warning: Unbrewed dylibs were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
@deiga
deiga / configure.log
Last active December 15, 2015 17:59
Error while `rvm install 1.9.3`
[2013-04-03 12:21:07] ./configure
current path: /Users/timosand/.rvm/src/ruby-1.9.3-p392
command(12): ./configure --enable-shared --disable-install-doc --with-readline-dir="$(brew prefix readline)" --prefix=/Users/timosand/.rvm/rubies/ruby-1.9.3-p392 --with-opt-dir=/usr/local/opt/libyaml:/usr/local/opt/readline:/usr/local/opt/libxml2:/usr/local/opt/libxslt:/usr/local/opt/libksba:/usr/local/opt/openssl:/usr/local/opt/sqlite --disable-install-doc --without-tcl --without-tk --enable-shared
configure: WARNING: you should use --build, --host, --target
configure: WARNING: you should use --build, --host, --target
configure: WARNING: invalid host type: readline)"
configure: WARNING: unrecognized options: --with-readline-dir, --without-tcl, --without-tk
checking build system type... Invalid configuration `prefix': machine `prefix' not recognized
configure: error: /bin/sh tool/config.sub prefix failed