Skip to content

Instantly share code, notes, and snippets.

def parse(str)
matches = str.scan(/\([^|]+\|[^)]+\)/)
pairs = matches.map { |match| match[1...-1].split("|") }
(pairs.count - 1)
.times
.to_a
.reduce(pairs[0]) { |acc, i| acc.product(pairs[i + 1]) }
.map { |substition_array| substition_array.flatten }
.map do |subs|
matches
+----------------------+-----------+----------+-----------+----------+
| Time of Grant | T-6 Hours | T | T+6 Hours | High |
+----------------------+-----------+----------+-----------+----------+
| 23 Sep 2016 09:06:03 | 598.54 | 600.99 | 602.6 | 603.21 |
| 06 Aug 2016 18:56:31 | 587.27 | 594.17 | 594.95 | 595.1 |
| 14 Dec 2016 07:37:31 | 780.78 | 778.35 | 778.94 | 779.95 |
| 20 May 2017 16:38:36 | 1997.0 | 2048.75 | 2065.47 | 2086.26 |
| 24 Jan 2018 00:54:10 | 10680.02 | 10879.34 | 11264.71 | 11415.03 |
| 10 Dec 2016 21:40:26 | 776.14 | 767.49 | 769.56 | 770.24 |
| 23 Jun 2016 00:16:51 | 584.53 | 593.92 | 575.89 | 601.0 |
+----------------------+-----------+----------+-----------+----------+
| Time of Grant | T-6 Hours | T | T+6 Hours | High |
+----------------------+-----------+----------+-----------+----------+
| 06 Feb 2018 12:32:52 | 6872.74 | 7737.01 | 7558.75 | 7930.12 |
| 23 Jan 2018 04:07:55 | 10411.78 | 10143.28 | 11278.32 | 11334.54 |
| 19 Jan 2018 17:56:59 | 11266.21 | 11658.4 | 12550.0 | 12663.47 |
| 19 Jan 2018 05:08:11 | 11517.03 | 11934.06 | 11291.66 | 11965.33 |
| 18 Jan 2018 08:02:00 | 11222.25 | 11949.07 | 11515.41 | 11995.0 |
| 17 Jan 2018 11:18:53 | 10424.74 | 10035.62 | 11509.25 | 11615.88 |
| 16 Jan 2018 14:22:53 | 12317.74 | 10290.28 | 10811.34 | 12265.38 |
+----------------------+-------------+------------+---------------+------------+
| Time of Grant | Grant USD | T-12 Hours | Time of Grant | T+12 Hours |
+----------------------+-------------+------------+---------------+------------+
| 06 Feb 2018 20:32:52 | 71553556.56 | 7397 | 6128 | 7815 |
| 23 Jan 2018 12:07:55 | 100000000.0 | 11879 | 10788 | 11380 |
| 20 Jan 2018 01:56:59 | 100000000.0 | 11268 | 11748 | 13026 |
| 19 Jan 2018 13:08:11 | 100000000.0 | 10684 | 11080 | 12297 |
| 18 Jan 2018 16:02:00 | 100000000.0 | 9969 | 11261 | 12117 |
| 17 Jan 2018 19:18:53 | 100000000.0 | 11683 | 11212 | 9213 |
| 16 Jan 2018 22:22:53 | 100000000.0 | 13919 | 11808 | 10180 |
29-11-2013 0:07 - UID: 817985 Type: buy Currency: USD BTC: 16.61124644 Fiat: 18709.31
29-11-2013 0:12 - UID: 817985 Type: buy Currency: USD BTC: 17.49854918 Fiat: 19402.8
29-11-2013 0:20 - UID: 817985 Type: buy Currency: USD BTC: 12.01301395 Fiat: 13346.46
29-11-2013 0:30 - UID: 817985 Type: buy Currency: USD BTC: 14.04190796 Fiat: 15172.05
29-11-2013 0:33 - UID: 817985 Type: buy Currency: USD BTC: 18.03482617 Fiat: 19785.76
29-11-2013 0:38 - UID: 817985 Type: buy Currency: USD BTC: 10.02069695 Fiat: 11011.54
29-11-2013 0:47 - UID: 817985 Type: buy Currency: USD BTC: 16.80501168 Fiat: 18256.07
29-11-2013 0:56 - UID: 817985 Type: buy Currency: USD BTC: 13.46333525 Fiat: 15078.58
29-11-2013 1:01 - UID: 817985 Type: buy Currency: USD BTC: 14.60390798 Fiat: 16324.46
29-11-2013 1:10 - UID: 817985 Type: buy Currency: USD BTC: 18.89383201 Fiat: 21909.61
var CALL_TO_ACTION = {
disco : "Help the president win by dancing RIGHT NOW!" ,
post_to_wall : "Post on your Facebook how awesome we are RIGHT NOW!",
tweet : "Post on your Twitter how awesome we are RIGHT NOW!" ,
virtual_phone_bank: "Sign up and start saving babies RIGHT NOW!"
};
var CALL_TO_ACTION = {
disco : "Help the president win by dancing RIGHT NOW!" ,
post_to_wall: "Post on your Facebook how awesome we are RIGHT NOW!",
tweet : "Post on your Twitter how awesome we are RIGHT NOW!" ,
virtual_phone_bank: "Sign up and start saving babies RIGHT NOW!"
};
var CALL_TO_ACTION = {
disco : "Help the president win by dancing RIGHT NOW!" ,
post_to_wall: "Post on your Facebook how awesome we are RIGHT NOW!",
tweet : "Post on your Twitter how awesome we are RIGHT NOW!"
};
render("/views/homepage/header", {title: "Obama for America", subtitle: "Yes We Can!"} , {layout: false})
render("/views/homepage/hero" , {img: "/assets/heros/denver-rally.png", caption: "A Better America Starts Today."} , {layout: true})
render("/views/footer" , {links: [{title: "about", url: "/about"}, {title: "privacy", url: "/privacy"}, {title: "terms", url: "/terms"}, {title: "jobs", url: "/careers"}]} , {layout: false})
render("/views/homepage/header", {title: "Obama for America", subtitle: "Yes We Can!"} , {layout: false})
render("/views/homepage/hero" , {img: "/assets/heros/denver-rally.png", caption: "A Better America Starts Today."}, {layout: true})
render("/views/footer" , {links: [{title: "about", url: "/about"}, {title: "privacy", url: "/privacy"}]} , {layout: false})