Skip to content

Instantly share code, notes, and snippets.

View jirikolarik's full-sized avatar

Jiri Kolarik jirikolarik

View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<?xml version="1.0" encoding="utf-8"?>
<SHOP>
<SHOPITEM>
<ITEM_ID>AB123</ITEM_ID>
<PRODUCTNAME>Nokia 5800 XpressMusic</PRODUCTNAME>
<PRODUCT>Nokia 5800 XpressMusic + pouzdro zdarma</PRODUCT>
<DESCRIPTION>Klasický s plným dotykovým uživatelským rozhraním</DESCRIPTION>
<URL>http://obchod.cz/mobily/nokia-5800-xpressmusic</URL>
<IMGURL>http://obchod.cz/mobily/nokia-5800-xpressmusic/obrazek.jpg</IMGURL>
<IMGURL_ALTERNATIVE>http://obchod.cz/mobily/nokia-5800-xpressmusic/obrazek2.jpg</IMGURL_ALTERNATIVE>
[
{
"code": "ab",
"name": "Abkhaz"
},
{
"code": "aa",
"name": "Afar"
},
{
@jirikolarik
jirikolarik / gist:525accba90a40237171e
Created January 23, 2015 09:04
Postgres isn't running fix on homebrew
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
rm /usr/local/var/postgres/postmaster.pid
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
@jirikolarik
jirikolarik / video_uploader.rb
Last active November 15, 2018 18:26
CarrierWave FFmpeg Uploader example
class VideoUploader < CarrierWave::Uploader::Base
include ::CarrierWave::Backgrounder::Delay
include CarrierWave::FFmpeg
RESOLUTIONS = [
{ version: :p1080, resolution: '1920x1080'},
{ version: :p720, resolution: '1280x720'}
]
# Choose what kind of storage to use for this uploader:
@jirikolarik
jirikolarik / missing.rb
Created November 15, 2013 19:46
Monkey Patching
module Missing
def new_method
# Do something
end
def override_method this_should_be_false = false
super
end
end
@jirikolarik
jirikolarik / routes.rb
Last active December 27, 2015 00:19
Devise + OmniAuth in engine
MyEngine::Engine.routes.draw do
devise_scope :user do
providers = Regexp.union(Devise.omniauth_providers.map(&:to_s))
match 'users/auth/:provider',
constraints: { provider: providers },
to: 'omniauth_callbacks#passthru',
as: :omniauth_authorize,
via: [:get, :post]
@jirikolarik
jirikolarik / gist:6932255
Created October 11, 2013 09:48
Errbit Devise.secret_key was not set
Last login: Fri Oct 11 11:34:49 on ttys002
jiris-imac:errbit jirikolarik$ cap deploy:setup deploy db:create_mongoid_indexes
* 2013-10-11 11:35:43 executing `deploy:setup'
* executing "mkdir -p /var/www/errbit2 /var/www/errbit2/releases /var/www/errbit2/shared /var/www/errbit2/shared/system /var/www/errbit2/shared/log /var/www/errbit2/shared/pids"
servers: ["errbit.imin.cz"]
Password:
[errbit.imin.cz] executing command
command finished in 169ms
* executing "chmod g+w /var/www/errbit2 /var/www/errbit2/releases /var/www/errbit2/shared /var/www/errbit2/shared/system /var/www/errbit2/shared/log /var/www/errbit2/shared/pids"
servers: ["errbit.imin.cz"]
@jirikolarik
jirikolarik / gist:6641866
Last active December 23, 2015 13:19
Setup domain for Ruby App (Capistrano deploy)
# Open ISPConfig and setup Apache on your domain
DocumentRoot /var/www/domain.tld/web/current/public
PassengerPreStart http://domain.tld/
@jirikolarik
jirikolarik / gist:6641740
Last active December 23, 2015 13:19
Update Passenger
# Update passenger
gem update passenger
# Show available passengers
gem list passenger
# Uninstall old passengers
gem uninstall passenger -v 4.0.18
# Install new Apache module