Skip to content

Instantly share code, notes, and snippets.

View JustinChristensen's full-sized avatar

Justin Christensen JustinChristensen

  • Minneapolis, MN
View GitHub Profile
test "date has display column but sorts by survey column" do
@entries = @sr.entries(:sorting_order_by => 577, :sorting_dir => 'ASC')
@entries.collect! { |entry| entry[2] }
assert_equal @ordered_dates_asc, @entries
assert_not_equal @ordered_dates_desc, @entries
debugger
@entries = @sr.entries(:sorting_order_by => 577, :sorting_dir => 'DESC')
@entries.collect! { |entry| entry[2] }
assert_equal @ordered_dates_desc, @entries
assert_not_equal @ordered_dates_asc, @entries
class SurveyReportOrderByColumnTest < ActiveSupport::TestCase
setup do
@survey_report = FormBuilder::SurveyReport.new(:survey_id => 132, :name => "Foo Bar Report")
@survey_report.data = {'576' => 1, '577' => 2, '578' => 3}
@survey_report.filters = []
@ordered_dates_asc = ["03/30/1962", "03/30/1979", "09/01/2000", "05/11/2008"]
@ordered_dates_desc = @ordered_dates_asc.reverse
@ordered_names_asc = ["Bob", "Coach", "Third", "tom"]
@ordered_names_desc = @ordered_names_asc.reverse
Delayed::Worker.max_attempts = 25
Delayed::Worker.destroy_failed_jobs = true # destroy after 25 attempts
Delayed::Worker.default_priority = 10 # otherwise defaults to 0 and lower numbers run first
# Only use delayed_job if we're in production or if you explicitly set it.
Delayed::Worker.delay_jobs = Rails.env.production? || ENV['DELAYED_JOB']
(function (window, $, undefined) {
var myGlobal;
var module = {
moduleMethod1: function () {
myGlobal = 42;
},
moduleMethod2: function () {
console.log(myGlobal);
array(10) {
[0]=&gt;
object(stdClass)#877 (104) {
["address"]=&gt;
object(stdClass)#434 (5) {
["address1"]=&gt;
string(16) "650 Dresher Road"
["city"]=&gt;
string(7) "Horsham"
["countryID"]=&gt;
<style>
#box1 {
position:absolute;
top:0;
left:0;
width:100%;
height:100%;
z-index:-1;
# include <iostream>
# include <cstdio>
#include <cmath>
#include <vector>
#include <unordered_map>
#include <array>
using namespace std;
float logBase2(float N)
{
"shell_cmd": "$0 --version"
}
// the output from this is an error but it shows me what shell my builder is trying to use:
// /Users/wroathe/.bash_profile: line 131: shopt: globstar: invalid shell option name
// /bin/bash: --version: command not found
// [Finished in 0.3s with exit code 127]
// [shell_cmd: --version]
{
"animation_enabled": false,
"auto_complete_commit_on_tab": true,
"bold_folder_labels": true,
"caret_style": "smooth",
"color_scheme": "Packages/User/Solarized (Light) (SL).tmTheme",
function wrap_youtube_autoembed_in_flexbox($html, $url) {
if (stripos($url, "youtube") !== false) {
$html = '<div class="flex-video widescreen">' . $html . '</div>';
}
return $html;
}
add_filter("oembed_result", "wrap_youtube_autoembed_in_flexbox", 10, 2);