Skip to content

Instantly share code, notes, and snippets.

View jywarren's full-sized avatar

Jeffrey Warren jywarren

View GitHub Profile
@jywarren
jywarren / database.yml
Last active August 26, 2015 19:13
c9.io setup scripts
# Warning: The contents of the database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
adapter: mysql2
username: <username>
password:
database: publiclab_test
encoding: utf8
pool: 5
@jywarren
jywarren / exiftool-sky-camera.txt
Last active August 29, 2015 13:57
output of exiftool on a Sky Camera photo
> exiftool Downloads/Picture_143402113447.jpg
ExifTool Version Number : 9.28
File Name : Picture_143402113447.jpg
Directory : Downloads
File Size : 1768 kB
File Modification Date/Time : 2014:03:05 11:01:53-05:00
File Access Date/Time : 2014:03:05 11:01:52-05:00
File Inode Change Date/Time : 2014:03:05 11:01:56-05:00
File Permissions : rw-r--r--
@jywarren
jywarren / migrate.log
Created May 30, 2014 15:43
measure of table sizes?
-- execute("ALTER TABLE content_field_bbox ENGINE = InnoDB")
-> 2.4616s
-- execute("ALTER TABLE content_field_image_gallery ENGINE = InnoDB")
-> 3.0838s
-- execute("ALTER TABLE content_field_main_image ENGINE = InnoDB")
-> 2.8453s
-- execute("ALTER TABLE content_field_map_editor ENGINE = InnoDB")
-> 0.4688s
-- execute("ALTER TABLE content_field_mappers ENGINE = InnoDB")
-> 0.4575s
@jywarren
jywarren / gems.log
Created May 30, 2014 16:19
SpectralWorkbench.org gems
arren@spectralwb:~$ gem list
*** LOCAL GEMS ***
actionmailer (3.2.13, 2.3.15)
actionpack (3.2.13, 2.3.15)
activemodel (3.2.13, 3.2.11)
activerecord (3.2.13, 2.3.15)
activeresource (3.2.13, 2.3.15)
activesupport (3.2.13, 3.2.11, 2.3.15)
@jywarren
jywarren / equalize.js
Created July 30, 2014 21:18
equalizes the area under the curve of any spectra displayed
setup: function() {
// code to run on startup
// assume the same # of datapoints for now
// (this could be a poor assumption but we could bin them)
$.each($W.data,function(index,spectrum){
var sum = 0
$.each(spectrum.data,function(i,v){
<form action="/warper/create" enctype="multipart/form-data" id="warpable_upload_form" method="post">
<input name="authenticity_token" type="hidden" value="otjpq17Z9OVnJQcs8Kwr04P50IQUNC93VLRCTaQABKo=" />
<label for="warpable">Choose a file from your computer (10mb max):</label>
<input id="warpable_uploaded_data" name="warpable[uploaded_data]" size="30" type="file" />
<input id="warpable_map_id" name="map_id" type="hidden" value="5942" />
<input name="commit" type="submit" value="Upload" />
</form>
@jywarren
jywarren / research-notify.js
Created August 10, 2014 17:15
Creates a PublicLab.org research note draft based on the selected text.
// Creates a PublicLab.org research note draft based on the selected text.
//Bookmarklet: javascript:(function(){document.body.appendChild(document.createElement('script')).src='http://publiclab.org/research-notify.js';})()
//Nice tips on jquery inclusion etc here: http://www.smashingmagazine.com/2010/05/23/make-your-own-bookmarklets-with-jquery/
/*
To-do:
* make it check if there's already text selected
@jywarren
jywarren / autosize_y.js
Created August 11, 2014 19:03
A SpectralWorkbench.org macro to set the y-axis scale to auto-size
setup: function() {
// code to run on startup
flotoptions.yaxis.max = null
$.plot($("#graph"),$W.data,flotoptions);
},
draw: function() {
// code to run every frame
}
warren$ exiftool /Users/warren/Desktop/IMG_20140420_180322.jpg
ExifTool Version Number : 9.28
File Name : IMG_20140420_180322.jpg
Directory : /Users/warren/Desktop
File Size : 1384 kB
File Modification Date/Time : 2014:04:20 19:03:23-04:00
File Access Date/Time : 2014:08:18 15:35:53-04:00
File Inode Change Date/Time : 2014:08:04 15:21:19-04:00
File Permissions : rwxr-----
File Type : JPEG
@jywarren
jywarren / equalize-height.js
Created September 22, 2014 19:56
equalizes the height of the graphs of any spectra displayed in SpectralWorkbench.org
setup: function() {
// code to run on startup
// assume the same # of datapoints for now
// (this could be a poor assumption but we could bin them)
// go through each spectrum
$.each($W.data,function(index,spectrum){
// determine highest y-height
var highest = 0
$.each(spectrum.data,function(i,v){