Skip to content

Instantly share code, notes, and snippets.

@DouglasAllen
DouglasAllen / readme.md
Last active September 30, 2015 16:18
public controller
$ gem install rails
$ rails new testapp
$ cd testapp

If you would like to serve a local copy of the welcome page for Rails.

$ rails generate controller public
$ cd config

# copy this code into routes.rb
@DouglasAllen
DouglasAllen / getajd_time
Created February 15, 2012 16:35
A liitle ditty to play with Julian
#!/usr/local/rvm/rubies/ruby-1.9.3-p125/bin/ruby
# a trick to block late entries.
require 'date'
time = Time.now.utc
theDate = Date.new(time.year, time.month, time.day)
=begin
=end # just put a blank space first and everything else is commented out.
puts time
puts theDate
@DouglasAllen
DouglasAllen / non_array_method_sort.rb
Created February 20, 2012 08:18
Some debugging techniques that I'm learning to use.
#!/usr/local/rvm/rubies/ruby-1.9.3-p125/bin/ruby
# a neat trick to block with.
=begin
[code ruby]
It never hurts to document your code
vars
a_word = "" # a nill string
words = [] # an empty array for input and sorting
words2 = [] # an empty array for output and sorting
j = 0 # inner iterater counter
@DouglasAllen
DouglasAllen / first_app_read_me.txt
Created February 20, 2012 16:16
first_app_read_me
A rails 3.0.11 app
The main page displays a way to calculate the Equation of Time.
This may be used when finding sun rise and sun set times or for navigation using the Sun.
Also one may use a rest address "time/julian".
This will show the current UTC date, time and Julian Day Number with the day fraction added. ex: (2455952.71212963)
There is also a file in /lib to be run in ruby standalone that will iterate through the first four days of the year.
It tries to find the exact time of perihelion and the lambda (ecliptic longitude) at that time.
note: (different years may crash it) Try changing the value that ma is compared to to a slightly higher number.
@DouglasAllen
DouglasAllen / cms_info_links.json
Created February 21, 2012 15:44
Links that I like about Content Management
@DouglasAllen
DouglasAllen / bookmarks.txt
Created February 21, 2012 22:25
my bookmarks
http://www.kahvi.org/
http://www.infoq.com/news/Embedding-C-in-Ruby
http://www.infoq.com/news/2009/08/haskell-ruby-hubris
http://www.apress.com/9781590599112
http://www.infoq.com/presentations/archaeopteryx-bowkett
http://www.developer.com/ws/android/development-tools/android-vs.-qt-a-mobile-developers-comparative-review.html
http://tx81z.blogspot.com/2011/06/unimidi-platform-independent-realtime.html
http://vimeo.com/22110958
http://vimeo.com/search/videos/search:Archaeopteryx%2C%20a%20revolutionary%20MIDI%20generato/st/c9448505
@DouglasAllen
DouglasAllen / mycurlbookmarks.html
Created February 22, 2012 15:00
Using curl day four of Ruby Learning dot org
<h3>Videos<h3>
list=PL170BCFD6BF55FC05
http://vimeo.com/8137911
http://vimeo.com/14000935
http://www.youtube.com/watch?v=3Jf9FakGPN8
http://www.youtube.com/watch?v=5BY9K5t1i2Q
http://www.youtube.com/watch?v=5YgIflLST4Q
http://www.youtube.com/watch?v=CsBVaJelurE&feature=results_main&playnext=1&list=PL961B81706BCDA721
http://www.youtube.com/watch?v=KKQS8EDG1P4
http://www.youtube.com/watch?v=M2HLGZJi0Hk
@DouglasAllen
DouglasAllen / ruby_inline_c.rb
Created February 26, 2012 00:55
an example for using inline gem
#!/usr/bin/env ruby
#note: do not use *.rb for shell execution. Copy and rename to "ruby_inline_c".
require 'rubygems'
require 'inline'
class Example
inline(:C) do |builder|
@DouglasAllen
DouglasAllen / puts_array.rb
Created March 1, 2012 01:04
My own puts for arrays
#!/usr/bin/env ruby
# puts_array.rb
a = [1,4,2,0,8,0,0,3,9]
p a
puts a.inspect
puts a
puts
# my own puts a
@DouglasAllen
DouglasAllen / beemp3_embeddable.html
Created March 2, 2012 00:10
One Day At A Time by Joe Walsh
<div>
<table width=320 border=0>
<tr>
<td>
<center>
<object width="320" height="200">
<param name="movie" value="http://www.youtube.com/v/CQVFpfVSUUU&&fs=1">
</param>
<param name="allowFullScreen" value="true">
</param>