Please see the Hackpad where we can all contribute!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-----BEGIN PGP MESSAGE----- | |
Version: Keybase OpenPGP JS 0.0.1 | |
Comment: https://keybase.io/crypto | |
wcFMA9xpXI1SoNwqAQ/+IDtM5wOpxqsrxRpZUW9IQlciTDLBUYb4fCdtgU1/E9CW | |
ANY5p51/qDJTTE1TJDFKjz20505k06fCZdhT4klHoeFtezEnc3uYPFR0Qb8GqJLS | |
hYWOu/ANlzy2STn0uRsaAbTD2B44fR7XZCBXsNEtoOgcvt7ylTOXszZjvLk7istt | |
01wftl+P/Y03bjZtgc4PvBdv0uytq366vIlIqfo0kbAC7ffajd4AdriaD9UIU4S6 | |
eQpEUIe/u20cEIDIYleuckYP4sTj9KzJtbRopH5C4js2+neJJ3IEfmL5bMbSmtRu | |
xLn5BuZ2T9HM/sfF6QRyI7TRfDJXz3lUSJyboy+upoQNdPMibW7x5SKoHcdcbPtt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~/Development/sandbox | |
❯ dbundle gem foobar --ext | |
create foobar/Gemfile | |
create foobar/Rakefile | |
create foobar/LICENSE.txt | |
create foobar/README.md | |
create foobar/.gitignore | |
create foobar/.consolerc | |
create foobar/foobar.gemspec | |
create foobar/lib/foobar.rb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 2b0c152b9eacdbcbdb47c3aadf47f75b0d373e17 Mon Sep 17 00:00:00 2001 | |
From: Andre Medeiros <me@andremedeiros.info> | |
Date: Tue, 13 May 2014 17:45:26 +0100 | |
Subject: [PATCH] Run an application loop. | |
--- | |
ext/skruby/extconf.rb | 2 +- | |
ext/skruby/skruby.m | 3 +++ | |
ext/skruby/skruby_application.h | 8 ++++++++ | |
ext/skruby/skruby_application.m | 36 ++++++++++++++++++++++++++++++++++++ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% Copyright (C) 2001-2012 Artifex Software, Inc. | |
% All Rights Reserved. | |
% | |
% This software is provided AS-IS with no warranty, either express or | |
% implied. | |
% | |
% This software is distributed under license and may not be copied, | |
% modified or distributed except as expressly authorized under the terms | |
% of the license contained in the file LICENSE in this distribution. | |
% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright (c) Sergey Lyubka, 2013. | |
// All rights reserved. | |
// This program is used to embed arbitrary data into a C binary. It takes | |
// a list of files as an input, and produces a .c data file that contains | |
// contents of all these files as collection of char arrays. | |
// Usage: | |
// 1. Compile this file: | |
// cc -o embed embed.c | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void | |
dz_cmyk_to_rgb(fz_context *ctx, fz_colorspace *cs, const float *cmyk, float *rgb) { | |
static cmsHTRANSFORM transform = NULL; | |
if(!transform) { | |
cmsHPROFILE cmyk_profile, rgb_profile; | |
size_t cmyk_size, rgb_size; | |
const char *cmyk_data = find_embedded_file("cmyk.icc", &cmyk_size); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ApplicationController < ActionController::Base | |
protected | |
# Protected: Internally redirects and renders a request. | |
# | |
# Example: | |
# | |
# def latest | |
# post = Post.last |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
yes = -> { puts "Y"; true } | |
no = -> { puts "N"; false } | |
arr = [no, no, no, yes, no, no] | |
a = arr.find { |x| x.call } | |
puts a | |
# `a` wants to be true, not an instance of Proc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'ostruct' | |
class Context < OpenStruct | |
def fail(details) | |
@_failure = true | |
@_error = details | |
end | |
def fail!(details) | |
fail(details) | |
throw :halt |