Skip to content

Instantly share code, notes, and snippets.

@matid
matid / gist:10557431
Created April 12, 2014 21:19
keybase.md
### Keybase proof
I hereby claim:
* I am matid on github.
* I am matid (https://keybase.io/matid) on keybase.
* I have a public key whose fingerprint is BF77 1276 FCC7 254C 0C0E 28AE 8248 346F DDFC 3C94
To claim this, I am signing this object:
@matid
matid / tapes-help
Created October 15, 2013 14:26
Tapes: Help
If you need any help with Tapes, please email us at support@usetapes.com.
@matid
matid / tapes-privacy-policy
Created October 15, 2013 14:19
Tapes: Privacy Policy
# Privacy policy
Ink Labs Limited (“we” or “us”) are committed to protecting and respecting your privacy.
This policy (together with our Terms of Service and any other documents referred to) sets out the basis on which any personal data we collect from you, or that you provide to us, will be processed by us. Please read the following carefully to understand our views and practices regarding your personal data and how we will treat it. If you have any requests concerning your personal information please contact our support team by email at support@usetapes.com.
## Information we may collect from you
We collect personal information about you (“data”) when you subscribe for our Service. We may also collect information automatically about your use of our website through cookies and other devices.
@matid
matid / 1.rb
Created September 17, 2010 11:23
class PostTest < ActiveSupport::TestCase
test "adds 20 points to post author" do
@post.save!
assert 20, @post.author.points # should be assert_equal
end
should "add 20 points to post author" do
@post.save!
@post.author.points == 20 # no assertion, should be "@post.author.points.should == 20"
end
# config/initializers/rails3.rb
Dir.glob(File.join(RAILS_ROOT, "lib", "rails3", "**", "*")).map { |path| require path }
# lib/rails3/presence.rb
class Object
def presence
self if present?
end
end
class Article
attr_accessor :title, :body
end
<?php
$array = array('abc', 'def');
$string = "String with 'abc' or 'def' in it";
function find($string, $array){
foreach($array as $token){
if(strpos($string, $token) !== false){
return true;
}
#<ActionView::ReloadableTemplate:0x3b8b750 @previously_last_modified=Tue Mar 17 12:33:12 +0100 2009,
@_memoized_method_segment=["app47views47mailer47activation46de46text46plain46erb"], @format="de",
@_memoized_relative_path=["app/views/mailer/activation.de.text.plain.erb"], @extension=nil,
@_memoized_method_name_without_locals=["_run_app47views47mailer47activation46de46text46plain46erb"],
@load_path="/Users/matid/Projects/pokerring.com/trunk/app/views", @base_path="mailer",
@filename="/Users/matid/Projects/pokerring.com/trunk/app/views/mailer/activation.de.text.plain.erb",
@locale=nil, @name="activation", @template_path="mailer/activation.de.text.plain.erb">
#<ActionView::ReloadableTemplate:0x3b841e4 @previously_last_modified=Tue Mar 17 12:33:25 +0100 2009,
@_memoized_method_segment=["app47views47mailer47activation46en46text46plain46erb"], @format="en",
<h1>Articles</h1>
<% paginate(@articles).each do |article| %>
<div>
<h2><%= article.title %></h2>
<p><%= article.body %></h2>
</div>
<% end %>
class Articles < ApplicationController
def index
@articles = Article.all
end
end