Skip to content

Instantly share code, notes, and snippets.

View dennisreimann's full-sized avatar
still hungry. still foolish.

d11n dennisreimann

still hungry. still foolish.
View GitHub Profile

This allows you to use the following video streaming services outside of the US from your Mac without having to use a proxy or VPN, so no big bandwidth issues:

  • Hulu / HuluPlus
  • CBS
  • ABC
  • MTV
  • theWB
  • CW TV
  • Crackle
  • NBC
@mixin mobile_bg($file){
background-image: image-url('mobile/standard/#{$file}');
@media screen and (-webkit-min-device-pixel-ratio: 2) {
background-image: image-url('mobile/retina/#{$file}');
background-size: image-width('mobile/standard/#{$file}') image-height('mobile/standard/#{$file}');
}
}
// Usage
@halfbyte
halfbyte / ploppconvert.rb
Created July 6, 2012 15:56
ploppcast conversion
input = ARGV[0]
output = ARGV[1]
unless input && output
puts "usage IN OUT" and exit
end
system "ffmpeg -i '#{input}' -map 0:0 -vn -acodec copy #{output}-1.m4a -map 0:1 -vn -acodec copy #{output}-2.m4a"
@bumi
bumi / active_support_notification_matcher.rb
Created July 16, 2012 13:42
rpsec matcher for matching ActiveSupport::Notifications events
# usage:
# expect {}.to publish_notification("object:created").with({:id => 1})
# expect {}.to publish_notification("object:created").with {|actual_payload| actual_payload[:id].present? }
module ActiveSupportNotificationMatchers
class PublishNotifications
def initialize(event_name)
@event_name = event_name
@payload = nil
end
@masone
masone / integration_test_helper.rb
Created July 16, 2012 18:43
Headless integration testing of facebook dialogs with capybara-webkit

## Most important settings

Create a new facebook app (1) and make sure the canvas url (2) in the basic tab matches the host and port configured with Capybara.server_port and Capybara.app_host. Activating sandbox mode (3) in the advanced tab enables you to roll without providing an SSL canvas url. You want to set the display mode (4) of your facebook dialogs to page, which is also the default.

  1. https://developers.facebook.com/apps
  2. http://screencast.com/t/lt6ORnb1sf
  3. http://screencast.com/t/tPSUyE6s
  4. https://developers.facebook.com/docs/reference/dialogs/
@greypants
greypants / README.markdown
Last active October 17, 2023 05:49 — forked from reagent/nav_link.rb
RAILS 3: nav_link helper for adding 'selected' class to navigation elements
@erotte
erotte / private.xml
Created August 25, 2012 23:09
KeyRemap4MacBook Umlaute mit ALT-Modifier
<?xml version="1.0"?>
<!-- Key Mappimgs for http://pqrs.org/macosx/keyremap4macbook/ -->
<root>
<item>
<name>German Umlaute on US Keyboard Layout with ALT modifier</name>
<appendix>Change Option+o to ö</appendix>
<appendix>Change Option+a to ä</appendix>
<appendix>Change Option+u to ü</appendix>
<identifier>remap.org.openhort.german_umlaute_with_ALT_modifier</identifier>
anonymous
anonymous / example.vhost.conf
Created September 5, 2012 19:29
apache vhost conf for rails
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName hostname.com
DocumentRoot /var/www/vhosts/ruby/htdocs/public
CustomLog /var/www/vhosts/ruby/log/access.log combined
ErrorLog /var/www/vhosts/ruby/log/error.log
<Directory "/var/www/vhosts/ruby/htdocs/public">
SetOutputFilter DEFLATE
@dennisreimann
dennisreimann / .htaccess
Created September 6, 2012 14:30
Uberspace htaccess for Rails apps
RewriteEngine On
RewriteBase /
# ensure the browser supports gzip encoding
RewriteCond %{HTTP:Accept-Encoding} \b(x-)?gzip\b
RewriteCond %{REQUEST_FILENAME}.gz -s
RewriteRule ^(.+) $1.gz [L]
# ensure correct Content-Type and add encoding header
<FilesMatch \.css\.gz$>
@adamgit
adamgit / gist:3705459
Last active December 17, 2024 00:14
Automatically create cross-platform (simulator + device) static libraries for Objective C / iPhone / iPad
##########################################
#
# c.f. http://stackoverflow.com/questions/3520977/build-fat-static-library-device-simulator-using-xcode-and-sdk-4
#
# Version 2.82
#
# Latest Change:
# - MORE tweaks to get the iOS 10+ and 9- working
# - Support iOS 10+
# - Corrected typo for iOS 1-10+ (thanks @stuikomma)