Skip to content

Instantly share code, notes, and snippets.

View gist:25248d6a4a3243fe876a18242f61a39b
times in msec
clock self+sourced self: sourced script
clock elapsed: other lines
000.049 000.049: --- NVIM STARTING ---
000.929 000.880: locale set
001.421 000.492: inits 1
001.441 000.020: window checked
001.623 000.182: parsing arguments
001.884 000.261: expanding arguments
View frequency_tests.erl
-module(frequency_tests).
-include_lib("eunit/include/eunit.hrl").
-define(setup(F), {setup, fun start/0, fun stop/1, F}).
%%%
%%% TESTS DESCRIPTIONS
%%%
boot_up_test_() ->
{"Can be started with a registered name",
View frequency.erl
%% Based on code from
%% Erlang Programming
%% Francecso Cesarini and Simon Thompson
%% O'Reilly, 2008
%% http://oreilly.com/catalog/9780596518189/
%% http://www.erlangprogramming.org/
%% (c) Francesco Cesarini and Simon Thompson
-module(frequency).
-export([init/0]).
@dalizard
dalizard / rules for good testing.md
Created Nov 18, 2016 — forked from Integralist/rules for good testing.md
Sandi Metz advice for writing tests
View rules for good testing.md

Rules for good testing

Look at the following image...

...it shows an object being tested.

You can't see inside the object. All you can do is send it messages. This is an important point to make because we should be "testing the interface, and NOT the implementation" - doing so will allow us to change the implementation without causing our tests to break.

View mutt-sidebar.patch
diff -urN mutt-1.6.1/buffy.c mutt-1.6.1-sidebar/buffy.c
--- mutt-1.6.1/buffy.c 2016-05-02 03:02:12.397171385 +0100
+++ mutt-1.6.1-sidebar/buffy.c 2016-05-02 03:02:15.009212943 +0100
@@ -27,6 +27,10 @@
#include "mutt_curses.h"
+#ifdef USE_SIDEBAR
+#include "sidebar.h"
+#endif
View gist:c689ca883298cec0017759de3494667f
[1] pry(main)> module A
[1] pry(main)* module B; end
[1] pry(main)* end
=> nil
[2] pry(main)> A::B.class_eval { Module.nesting }
=> []
[3] pry(main)> A::B.class_eval('Module.nesting')
=> [A::B]
[4] pry(main)>
View gist:6221397
Destination Gateway Flags Refs Use Netif Expire
default 10.205.1.1 UGSc 17 43 en0
10.205.1/24 link#4 UCS 4 0 en0
10.205.1.1 bc:16:65:93:6a:93 UHLWIir 18 112 en0 1190
10.205.1.13 127.0.0.1 UHS 0 0 lo0
10.205.1.18 c8:a:a9:4a:62:80 UHLWIi 0 45 en0 1164
10.205.1.21 1c:75:8:c3:20:ab UHLWIi 3 2132 en0 1168
10.205.1.23 74:e5:b:d:e4:20 UHLWIi 0 0 en0 1109
127 127.0.0.1 UCS 0 0 lo0
127.0.0.1 127.0.0.1 UH 2 10146422 lo0
View gist:6164143
Top 50 slowest examples (299.23 seconds, 12.7% of total time):
SearchResult.strip_user_from_search_results removes users from search results, who have been banned by the user
8.73 seconds ./spec/models/search/search_result_spec.rb:55
Omniture tracking (set stat_secret.var_name variables) Profile visited Should set "prop17" to visited profile info (age1|[age2]#gender1|[gender2]#pic?#FFT|SFT)
and "prop5" to pageName_visitedProfileInfo
when visiting own profile (page my_profile_common_show)
8.56 seconds ./spec/features/omniture_tracker_spec.rb:444
SearchResult.strip_user_from_search_results does nothing when there are no banned relations
8.13 seconds ./spec/models/search/search_result_spec.rb:67
SearchResult.strip_user_from_search_results removes users from search results, who have banned the user
View gist:6007987
rspec ./spec/features/gallery_spec.rb:61 # Gallery check with photos should render gallery HTML in my profile, which has the right behaviour
rspec ./spec/features/gallery_spec.rb:86 # Gallery check with photos should load the first picture from the gallery as a profile picture
rspec ./spec/features/gallery_spec.rb:91 # Gallery check with photos should change the profile picture if you click on a picture from the gallery
rspec ./spec/features/gallery_spec.rb:97 # Gallery check with photos should see how photos look shared or not shared
rspec ./spec/features/gallery_spec.rb:122 # Gallery check without photos should not render gallery HTML in my profile
rspec ./spec/features/login_spec.rb:7 # Login Should log in a credits user
rspec ./spec/features/login_spec.rb:17 # Login Should log in a premium user
rspec ./spec/features/omniture_tracker_spec.rb:37 # Omniture tracking (set stat_secret.var_name variables) In all pages Should left "channel", "pageType", "state" and "zip" empty
rspec ./spec/features/omniture_trac
View gist:1560678
<%= form_for(@cart, @cart.line_items) do |f| %>
<ul data-role="listview" data-split-theme="a" data-split-icon="delete">
<% for item in @cart.line_items %>
<%= f.fields_for item, :index => item.id do |item_form| %>
<li>
<a href="#">
<%= image_tag item.image %>
<h1><%= item.model %></h1>
<dl>
You can’t perform that action at this time.