Skip to content

Instantly share code, notes, and snippets.

View rupurt's full-sized avatar
🏠
Working from home

Alex Kwiatkowski rupurt

🏠
Working from home
View GitHub Profile
@rupurt
rupurt / gist:5663013
Created May 28, 2013 14:08
Ember.js currentUser controller injection
Em.Application.initializer({
name: 'currentUser',
initialize: function(container) {
var store = container.lookup('store:main');
var currentUser = App.User.find('current');
container.register('user:current', currentUser, { instantiate: false });
container.injection('controller', 'currentUser', 'user:current');
}
@rupurt
rupurt / capybara.rb
Created July 29, 2013 21:52
Silence stderr from QtWebkit
Capybara.register_driver :webkit do |app|
connection = Capybara::Webkit::Connection.new(socket_class: TCPSocket, stderr: File.open('/dev/null', 'a'))
browser = Capybara::Webkit::Browser.new(connection)
Capybara::Webkit::Driver.new(app, browser: browser)
end
@rupurt
rupurt / gist:6800452
Created October 2, 2013 20:59
Kss custom routes
Kss::Engine.routes.draw do
get '/someurl' => 'controllername#actionname'
root :to => 'home#index'
end
@rupurt
rupurt / gist:7159363
Created October 25, 2013 18:19
CapybaraWebkit and Selenium with :debug tag
Capybara.default_driver = :webkit
RSpec.configure do |config|
config.before(debug: true) do
Capybara.current_driver = :selenium
end
config.after(debug: true) do
Capybara.use_default_driver
end
@rupurt
rupurt / ruby_public_private_protected_example.rb
Created August 1, 2014 17:27
Ruby public/private/protected
class PublicPerson
def initialize(name)
@name = name
end
def say_name
puts @name
end
def say_other_name(person)
@rupurt
rupurt / block_syntax.hbs
Created March 9, 2015 13:34
New Handlebars block syntax
{{#each people as |person|}}
My name is: {{person.name}}
{{/each}}
@rupurt
rupurt / ember_conf_2015_notes.md
Last active August 29, 2015 14:16
Ember Conf 2015 Notes

Ember Conf 2015 Notes

@rupurt
rupurt / custom_font_declaration.html
Created April 14, 2015 15:09
Custom font declaration
<style>
@font-face {
font-family: 'action_manbold_italic';
src: url('https://youdomain.com/some_folder/action_man_bold_italic-webfont.eot');
src: url('https://youdomain.com/some_folder/action_man_bold_italic-webfont.eot?#iefix') format('embedded-opentype'),
url('https://youdomain.com/some_folder/action_man_bold_italic-webfont.woff2') format('woff2'),
url('https://youdomain.com/some_folder/action_man_bold_italic-webfont.woff') format('woff'),
url('https://youdomain.com/some_folder/action_man_bold_italic-webfont.ttf') format('truetype'),
url('https://youdomain.com/some_folder/action_man_bold_italic-webfont.svg#action_manbold_italic') format('svg');
font-weight: normal;
@rupurt
rupurt / update_ssl_cert.sh
Last active August 29, 2015 14:22
Update SSL cert
#!/bin/bash
cd /usr/local/etc/openssl/certs/
curl -O http://curl.haxx.se/ca/cacert.pem
mv cacert.pem cert.pem
echo "export SSL_CERT_FILE=/usr/local/etc/openssl/certs/cert.pem" >> ~/.bash_profile.local
source ~/.bash_profile
@rupurt
rupurt / gist:455dd190f67b0a6195f8
Created June 1, 2015 21:01
Run update ssl cert
curl https://gist.githubusercontent.com/rupurt/a9e35c8c219a37eb90f6/raw/2397544c86ef149eedc3a3e9c645f3eb3c7319a7/update_ssl_cert.sh > /tmp/update_ssl_cert.sh && chmod 744 /tmp/update_ssl_cert.sh && /tmp/update_ssl_cert.sh