Skip to content

Instantly share code, notes, and snippets.

View danielpclark's full-sized avatar
✍️
Working from home on open source

Daniel P. Clark danielpclark

✍️
Working from home on open source
View GitHub Profile
<tr>
<td>
<%= hidden_field_tag "tmail[tmail_ids][]", '' %><%= check_box_tag "tmail[tmail_ids][]", email.id, nil, class: "tmail-check" %>
</td>
<% if current_user.registered_emails.count > 1 %>
<td><%= email.recipient.gsub(/@.*/,"") %></td>
<% end %>
<td><%= link_to email.body['From'], tmail_path(email.id) %></td>
<td><%= link_to email.body['Subject'], tmail_path(email.id) %></td>
<td><%= link_to email.created_at.strftime("%b %e, %C%y %l:%M%P"), tmail_path(email.id) %></td>
<select class="form-control" onchange="$('.complexity').val($(this).val())">
  <option>red</option>
  <option>yellow</option>
  <option>green</option>
</select>
<input class="form-control complexity" type="text" value="{{ page._new_gl_complexity  }}" />

The JavaScript will successfully change the value in the input field. But the field submits nothing when the form is submitted. Yet if I hand enter text into the input field that works. If I can get the field to submit data that was copied from the select menu then I will switch the input box to either "visibility:hidden;" or "display:none;".

function cleanText(css_selector){
var k = $(css_selector).clone();
k = k.find('script').remove().end();
return k.text();
}
function hookEmailComposer() {
function extractLast( term ) {
return $.trim(term.split(',').pop());
}
set nocompatible " We're running Vim, not Vi!
syntax enable
filetype off " Enable filetype detection
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
require 'minitest/reporters'
class ColorPoundSpecReporter < Minitest::Reporters::SpecReporter
# minitest-reporters methods for version 0.14.24
def pass(suite, test, test_runner)
common_print(suite, test, :green, 'PASS')
end
def skip(suite, test, test_runner)
common_print(suite, test, :yellow, 'SKIP')
#!/usr/bin/env ruby
$stdout.sync = true
while true
20.times do
sleep(60)
print "."
end
sound_bite = Dir.glob("/mnt/win7/Documents and Settings/daniel/Music/iTunes/iTunes Media/Music/Motivational Speech/Start The Day Right/*.mp3").sample
%x^/usr/bin/env mpg123 "#{ sound_bite }"^
print "*"
# ROUTE
scope :ujs, defaults: { format: :ujs } do
patch 'profiles' => 'ujs#profiles'
end
# TEST
require 'minitest/autorun'
class UjsRouteTest < ActionDispatch::IntegrationTest
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
def child_and_parent?(obj, user)
return true if obj.nil? # if nil then no need to worry about non-existent object (needed for devise)
@oldest = lambda {|o|
case
when o.pbt_parent.nil?
return o
else
@oldest.call(o.pbt_parent)
end
}
class A
def x(num)
num = num - 1
if num == 0
return @extra
else
@extra = Array(@extra) << num
x(num)
end