Skip to content

Instantly share code, notes, and snippets.

require 'bundler/inline'
gemfile true do
source 'https://rubygems.org'
gem 'active_model_serializers', github: 'rails-api/active_model_serializers', ref: 'd30aa4c'
end
print "==================================================\n\n"
class Shoe
attr_accessor :id, :name, :vendor
@andreaseger
andreaseger / .ruby-version
Last active August 29, 2015 14:17
active_type bug
ruby-2.2.0
# This beeing a plain ruby file do whatever you what
# like requiring some organization wide baseline rubocop config
# or a todo file
PoC.configure do |config|
# I've yet to find a better solution for the namespaceing issue so I can
# directly access the Metrics module
# even with a instance_eval/instance_exec from within the PoC module I have
# to call PoC::Cop::Metrics...
include PoC::Cop
@andreaseger
andreaseger / .gitignore
Last active January 2, 2016 05:29
download images of one piece manga chapter from kissmanga
chapters
@andreaseger
andreaseger / .gitignore
Last active January 2, 2016 05:29
download episodes from elixirsips.com - subscription required
sips/*
rss.xml
.bundle
auth.rb
@andreaseger
andreaseger / deploy.rb
Last active December 21, 2015 16:49
rails deploy w/ rvm, bundler, unicorn
# Automatically precompile assets
load "deploy/assets"
# Execute "bundle install" after deploy, but only when really needed
require "bundler/capistrano"
# Application name
set :application, "page"
# Application environment
// uses underscore.js stuff
E.Helpers.Html = {
equalHeights: function($el, minHeight, maxHeight) {
var heights,targetHeight;
heights = jQuery($el).map(function(){return jQuery(this).height();});
heights.push(minHeight);
targetHeight = maxHeight ? _.min([maxHeight, _.max(heights)]) : _.max(heights);
@andreaseger
andreaseger / rss-search.rb
Last active December 20, 2015 06:19
very simple rss fetcher to search for items
#!/bin/env ruby
require 'open-uri'
require 'rss'
require 'pry'
class Feedly
attr_accessor :url, :store
def initialize url
@url = url
@andreaseger
andreaseger / gist:5992883
Created July 14, 2013 01:49
Asus UL80vt Brightness workaround
#!/bin/sh
# /etc/acpi/actions/backlight
#acpi_fakekey $KEY_BRIGHTNESSDOWN
# added per http://forum.notebookreview.com/showpost.php?p=5665108&postcount=1235
#brightness=`echo $3 | sed 's/0000002//'`
#setpci -s 00:02.0 F4.B=${brightness}f
# added per mailing-list post