Skip to content
require 'formula'
class Wkhtmltopdf < Formula
homepage 'http://wkhtmltopdf.org/'
url 'http://download.gna.org/wkhtmltopdf/0.12/0.12.2/wkhtmltox-0.12.2_osx-cocoa-x86-64.pkg'
version '0.12.2'
def install
`cat Payload | gzip -d - | cpio -id`
`tar -xvf usr/local/share/wkhtmltox-installer/app.tar.xz`
require 'formula'
class Wkhtmltopdf < Formula
homepage 'http://code.google.com/p/wkhtmltopdf/'
url 'https://launchpad.net/ubuntu/+archive/primary/+files/wkhtmltopdf_0.9.0.orig.tar.gz'
sha256 '628363a79c82eb835e436cd62bce1b7323aed4e707affe57c3248e337a3ed18b'
version '0.9.0'
depends_on 'qt'
@instacuke
Feature: Instacuke
Scenario Outline:
Then I should <result>
Examples:
| result |
| succeed |
| be pending |
| fail |
module Launch
extend Fiddle::Importer
dlload '/usr/lib/system/liblaunch.dylib'
@launch_activate_socket = import_function(*parse_signature("int launch_activate_socket(const char *name, int **fds, size_t *cnt)"))
def self.launch_activate_socket(name)
raise ArgumentError, "name must be a string" unless name.is_a? String
fds_ptr = Fiddle::Pointer.new(0)
[:hash,
0,
2,
[:instance_variables,
[:string, 1, "session_id"],
1,
[:symbol, 0, "E"],
:true],
[:instance_variables,
[:string, 2, "f8e1b8152ba7609c28bbb17ec9263ba7"],

Let's examine locking in mysql.

Creating a lock timeout in mysql console:

$ mysql -e 'create database lock_test'
Query OK, 1 row affected (0.00 sec)

$ mysql lock_test -e 'create table lockables (id int primary key auto_increment)'
Query OK, 0 rows affected (0.01 sec)
require "ipaddr"
require "resolv"
require "socket"
class MDNS
IP = "224.0.0.251"
PORT = 5353
TTL = 255
def initialize(hosts=[])
# CREATE TABLE users (id INT NOT NULL AUTO_INCREMENT, age INT UNSIGNED, PRIMARY KEY id)
class User < ActiveRecord::Base
# column gives us age / age=
validates :age, presence: true, may_serve_alcohol: true
end
class MayServeAlcoholValidator < ActiveModel::EachValidator
def validate_each(model, attribute, value)
if model[attribute].present? && model[attribute] < 18
require "strscan"
class LenientCSV
def initialize(source)
@scanner = StringScanner.new(source)
end
def each
until @scanner.eos?
yield scan_row
# From https://stackoverflow.com/questions/6592038/change-the-name-of-the-id-parameter-in-routing-resources-for-rails3/13427336#13427336
#
# Unfortuantely, in Rails 3, the :key option for resources was
# removed, so you can no longer easily change the name for routes
# created in this way by just passing in an extra option.
#
# All is not lost, however; it seems in Rails 4, the :param option
# has been added, which seems to do exactly what you're looking for.
# You can take a look at the Rails 3 code compared to the Rails 4
# code.
Something went wrong with that request. Please try again.