Skip to content

Instantly share code, notes, and snippets.

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

Immi manufaktor

🏠
Working from home
View GitHub Profile
def test_void
@gateway.expects(:post_xml).returns(post_xml_void_accepted)`
assert response = @gateway.void(2826987, @options_void)`
assert_equal true, response.success?, 'Check if the transaction existst.'
assert_equal 'cancellation succeeded', response.message.to_s
end
set :application, 'domain'
set :deploy_to, '/var/www/domain.com'
set :repository, '.'
set :scm, :none
set :deploy_via, :copy
set :copy_compression, :gzip
set :use_sudo, false
set :user, 'domain_user'
set :copy_exclude, ['.git', 'src', '.sass-cache', 'Capfile', 'config']
# RubyGems
cd /usr/local/src
wget http://production.cf.rubygems.org/rubygems/rubygems-1.3.7.tgz
tar -zxf rubygems-1.3.7.tgz
cd rubygems-1.3.7
ruby setup.rb
cd
@manufaktor
manufaktor / config.rb
Created November 2, 2011 20:00
Middleman navigation helper
module Middleman::Features::Navigation
class << self
def registered(app)
app.helpers NavigationHelpers
end
alias :included :registered
end
module NavigationHelpers
@manufaktor
manufaktor / no-break
Created April 23, 2012 16:50
Preventing mid-line page breaks in wkhtmltopdf
.nbrk{
line-height: 1em
}
@manufaktor
manufaktor / readlinglist.rb
Created June 15, 2012 11:26
Extracting links from your Safari Reading List
# Extracting links from your Safari Reading List
#
# Copy your Safari Bookmarks file first:
# cp ~/Library/Safari/Bookmarks.plist
#
# Convert the binary plist to xml
# plutil -convert xml1 Bookmarks.plist
#
# install the plist gem
# gem install plist
// Font-face mixin
@mixin font-face($name, $path, $weight: normal, $style: normal){
@font-face {
font-family: $name;
src: url('#{$path}.eot');
src: url('#{$path}.eot?#iefix') format('embedded-opentype'),
url('#{$path}.woff') format('woff'),
url('#{$path}.ttf') format('truetype'),
url('#{$path}.svg#BariolRegularRegular') format('svg');
@manufaktor
manufaktor / media-queries.sass
Created April 4, 2013 10:59
Using SASS 3.2 for media query helpers
// A basic media query mixin that makes responsive work simple.
=respond-to($device)
@if $device == handheld
@media only screen and (min-width : 320px)
@content
@if $device == handheld-landscape
@media only screen and (min-width : 320px) and (orientation : landscape)
@manufaktor
manufaktor / application.js
Last active December 23, 2015 08:19
Custom events with ember.js and hammer.js
App = Ember.Application.create({
customEvents: {
swipeLeft: 'swipeLeft',
swipeRight: 'swipeRight',
swipeLeftTwoFinger: 'swipeLeftTwoFinger',
swipeRightTwoFinger: 'swipeRightTwoFinger',
dragDown: 'dragDown',
dragUp: 'dragUp',
dragDownTwoFinger: 'dragDownTwoFinger',
dragUpTwoFinger: 'dragUpTwoFinger'