Skip to content
View gist:cbf92b33db85d31eff86
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>console test</title>
<link rel="shortcut icon" type="image/png" href="lib/jasmine-2.2.0/jasmine_favicon.png">
<link rel="stylesheet" href="lib/jasmine-2.2.0/jasmine.css">
<script src="lib/jasmine-2.2.0/jasmine.js"></script>
View gist:0e7d096151e0ca02a020
:%s/\/\*\{-1}\_.\{-}\*\///g
View gist:ac4594ce5d4d6e3357ba
/*
Gmail Client (ideas)
Usage:
var gmailClient = newGmailClient(myAccessToken);
var response = gmailClient.execute({
url: "users/me/messages",
headers: {},
View willen-zum-leben
Zwei Dinge hat das Denken zu leisten: uns aus der naiven zur vertiefen Welt-
und Lebensbejahung zu füren und uns von ethischen Regungen zu einer
denknotwendigen Ethic gelangen zu lassen.
Vertiefe Welt- und Lebensbejahung besteht darin, dass wir den Willen haben,
unser Leben und alles durch uns irgendwie beeinflussbare Sein zu erhalten und
auf seinen höchsten Wert zu bringen. Sie verlangt von uns, dass wir alle
Ideale der materiellen und geistigen Vervollkommnung des Menschen, der
Gesellschaft und der Menschheit denken und uns durch sie zu stetem Wirken und
stetem Hoffen bestimmen lassen. Sie erlaubt uns nicht, uns auf uns selber
View rspec-guides.markdown

General guides

  • Use describe blocks for objects and methods ("given" scenarios)
  • Use context blocks for "when" scenarios
  • Avoid spec descriptions longer than 40 characters. Split into contexts if longer.
  • Prefer expect syntax
  • Use before blocks at the lowest scope necessary
    • e.g. start within it blocks, then move into describe, then only if necessary for all tests put outside of those.
  • Use validation tests and place them at the top of the describe block
View remote-working.markdown

Remote working

Germany specifics

Germany is 9 hours ahead (12am in AZ = 9am in Germany).

  • Available/awake times for me would be 12am-1:30pm az time (9am-10:30pm Germany)
  • Work 75% of time in morning/afternoon
  • Work/save 6-7pm (9-10am AZ time) for general standup and catch up at our normal time
View gist:6499960
# Wrap given block with link if..
def link_wrap_if(apply_link, url, opts={}, &block)
if apply_link
link_to capture(&block), url, opts
else
capture(&block)
end
end
View rails_tests_in_isolation.rb
require 'benchmark'
require 'socket'
ENV["RAILS_ENV"] = "test"
# Add test folder to load path
$: << './test'
puts Benchmark.measure{
# Assuming test_helper requires config/environment
View css_urlstrip.rb
urls = ""
DATA.each do |l|
img = l[/url\([^)]*\)/]
urls << "<img src=#{img.gsub(/url\(([^)]*)\)/, '\1')} /><hr />\n" if img
end
f = File.open("urltest.html", "w") {|file| file.truncate(0) } # Clear file contents
f = File.open("urltest.html", "w")
f.write urls
f.close
View block-to-partial
<%
#
# I originally needed to create a sidebar partial that had a div area where I could place custom links into. Finally found it.
# When I was trying to figure this out before and realized I needed to pass the view into :layout, rather than just using render 'layout'. Not sure why the block can't be passed otherwise but nonetheless...
#
# For explanation of options see
# http://guides.rubyonrails.org/layouts_and_rendering.html#options-for-render
#
%>
Something went wrong with that request. Please try again.