Skip to content

Instantly share code, notes, and snippets.

View ivar's full-sized avatar

Ivar Vasara ivar

  • Misc / Consultant
  • Vancouver
View GitHub Profile
@ivar
ivar / busted query
Last active August 29, 2015 14:03
Automated query to load table structure from Rspec and Rails does not recognize "properties_view" as a valid 'table'.
SELECT a.attname, format_type(a.atttypid, a.atttypmod),
pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod
FROM pg_attribute a LEFT JOIN pg_attrdef d
ON a.attrelid = d.adrelid AND a.attnum = d.adnum
WHERE a.attrelid = '"properties_view"'::regclass # NOTE properties_view is a view on properties table
AND a.attnum > 0 AND NOT a.attisdropped
ORDER BY a.attnum;

Keybase proof

I hereby claim:

  • I am ivar on github.
  • I am ivar (https://keybase.io/ivar) on keybase.
  • I have a public key whose fingerprint is 01D3 3F88 6CF1 DCA6 61F3 C456 9022 6A6E 7F7A 23F3

To claim this, I am signing this object:

@ivar
ivar / gist:2d865d8c28d5ffb229d8
Last active August 29, 2015 14:09
cannot delete unused docker image
ivar@bento-4 ~/Work/rew-docker $ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
ivar@bento-4 ~/Work/rew-docker $ docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
ubuntu 14.10 277eb4304907 2 weeks ago 228.5 MB
<none> <none> 7fa0dcdc88de 6 weeks ago 910 B
ivar@bento-4 ~/Work/rew-docker $ docker rmi 7fa0dcdc88de
Error response from daemon: No such id: ef872312fe1bbc5e05aae626791a47ee9b032efa8f3bda39cc0be7b56bfe59b9
@ivar
ivar / ruby-build log
Created December 29, 2014 22:56
failed ruby 2.2 ruby-build attempt
/tmp/ruby-build.20141229144532.25901 ~/.rbenv/plugins/ruby-build
HTTP/1.1 200 OK
Content-Type: binary/octet-stream
Content-Length: 16494584
Connection: keep-alive
Date: Thu, 25 Dec 2014 12:26:39 GMT
Last-Modified: Thu, 25 Dec 2014 10:02:26 GMT
ETag: "cd03b28fd0b555970f5c4fd481700852"
Accept-Ranges: bytes
Server: AmazonS3
@ivar
ivar / products_helper.rb
Created February 7, 2015 20:34
app/helpers/spree/products_helper.rb
#defined in app/helpers/spree/products_helper.rb
module Spree
module ProductsHelper
def each_date_bucket(&block)
..my method ..
end
end
end
# This declaration blows away the ProductsHelper included with Spree.
@ivar
ivar / gist:40c8e34bcd5b54b13ac0
Created March 7, 2015 00:42
Failure to install VMWare tools ( VMwareTools-9.9.2-2496486.tar.gz) on Ubuntu with kernel 3.13.0-46
~/vmware_cdrom/vmware-tools-distrib » uname -a
Linux rewdev 3.13.0-46-generic #77-Ubuntu SMP Mon Mar 2 18:23:39 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
~/vmware_cdrom » lsb_release -a No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.2 LTS
Release: 14.04
Codename: trusty
~/vmware_cdrom/vmware-tools-distrib » sudo ./vmware-install.pl Creating a new VMware Tools installer database using the tar4 format.
(defn greeting
([] (greeting "World"))
([msg] (str "Hello, " msg exclamation ))
([msg1, msg2](str msg1 ", " msg2 exclamation ))
)
(greeting "Good morning" "Clojure")
;; For testing
(assert (= "Hello, World!" (greeting)))
@ivar
ivar / upgrade.rb
Created September 21, 2015 19:27
Ivar's system upgrade script
#!/usr/bin/env ruby
puts "---- updating oh-my-zsh ---------------------------------"
puts `cd ~/.oh-my-zsh && git fetch && git rebase origin/master`
puts "---- updating rbenv ---------------------------------"
puts `cd ~/.rbenv && git pull && cd plugins/ruby-build && git pull`
puts "---- updating vim plugins ---------------------------------"
puts `cd ~/Work/dotfiles && git submodule foreach git pull origin master`
puts "---- updating brewed apps ---------------------------------"
puts `brew update && brew upgrade && brew cleanup`
task :check_deployment_branch, :except => {:no_release => true, :no_symlink => true} do
if rails_env == 'production'
CLI.ui.say "================================\nDeploying to PRODUCTION.\n================================\n\n"
# CLI.ui.say "Current production branch is set to: #{repository}"
set :branch, "master"
set :continue, Proc.new {CLI.ui.ask "Do you wish to continue? [yes/NO]"}
raise Error, "Failing production deploy" unless continue == 'yes' || continue == 'y'
else
CLI.ui.say "================================\nDeploying to #{deploy_type.upcase}.\n================================\n\n"
set :new_branch, Proc.new { CLI.ui.ask "Please pick your branch or press ENTER for #{branch}."}
@ivar
ivar / gist:663910
Created November 5, 2010 10:03
rvm errror when installing ree-1.8.7-2010.02
[2010-11-05 02:39:16] ./installer -a /Users/ivar/.rvm/rubies/ree-1.8.7-2010.02 --dont-install-useful-gems
./configure: line 4633: : command not found
rm: conftest.dSYM: is a directory
rm: conftest.dSYM: is a directory
configure: WARNING: Could not find the PC. Will not output failed addresses...
In file included from src/base/commandlineflags.h:55,
from src/tcmalloc.cc:114:
./src/base/basictypes.h: In constructor ‘AssignAttributeStartEnd::AssignAttributeStartEnd(const char*, char**, char**)’:
./src/base/basictypes.h:251: warning: ‘_dyld_present’ is deprecated (declared at /usr/include/mach-o/dyld.h:237)
./src/base/basictypes.h:251: warning: ‘_dyld_present’ is deprecated (declared at /usr/include/mach-o/dyld.h:237)