Skip to content

Instantly share code, notes, and snippets.

Avatar

Jeffrey Warren jywarren

View GitHub Profile
@jywarren
jywarren / database.yml
Last active Aug 26, 2015
c9.io setup scripts
View database.yml
# 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 Aug 29, 2015
output of exiftool on a Sky Camera photo
View exiftool-sky-camera.txt
> 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 / gems.log
Created May 30, 2014
SpectralWorkbench.org gems
View gems.log
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 / migrate.log
Created May 30, 2014
measure of table sizes?
View migrate.log
-- 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 / equalize.js
Created Jul 30, 2014
equalizes the area under the curve of any spectra displayed
View equalize.js
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){
View gist:26870dffc757cec68654
<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 Aug 10, 2014
Creates a PublicLab.org research note draft based on the selected text.
View research-notify.js
// 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 Aug 11, 2014
A SpectralWorkbench.org macro to set the y-axis scale to auto-size
View autosize_y.js
setup: function() {
// code to run on startup
flotoptions.yaxis.max = null
$.plot($("#graph"),$W.data,flotoptions);
},
draw: function() {
// code to run every frame
}
View exiftool.log
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 Sep 22, 2014
equalizes the height of the graphs of any spectra displayed in SpectralWorkbench.org
View equalize-height.js
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){