Skip to content

Instantly share code, notes, and snippets.

View bretdavidson's full-sized avatar

Bret Davidson bretdavidson

  • North Carolina State University Libraries
View GitHub Profile
@bretdavidson
bretdavidson / database.yml
Created March 13, 2013 17:12
Example for connecting RoR to a MAMP hosted database. Socket path assumes MAMP has been installed in the default directory. DATABASE_NAME, USERNAME, and PASSWORD will need to be replaced with the appropriate values from the database in MAMP. Default username and password are both root.
development:
adapter: mysql2
database: DATABASE_NAME
username: USERNAME
password: PASSWORD
socket: /Applications/MAMP/tmp/mysql/mysql.sock
host: localhost
pool: 5
timeout: 5000
encoding: utf8
<!DOCTYPE html>
<html>
<head>
<title>Data Join Demo</title>
<style>
#control {
margin-bottom: 20px;
}
#chart {
width:500px;
@bretdavidson
bretdavidson / README.md
Last active December 11, 2015 00:18 — forked from mbostock/README.md
Underscore.js equivalents in D3

Collections

each(array)

Underscore example:

_.each([1, 2, 3], function(num) { alert(num); });
@bretdavidson
bretdavidson / gist:3820069
Created October 2, 2012 15:22
Yahoo Leaked Passwords
# Statistics of the "450.000 leaked Yahoo accounts".
## More information available here:
http://blog.eset.se/statistics-about-yahoo-leak-of-450-000-plain-text-accounts/
https://twitter.com/nilssonanders
Total entries = 442773
Total unique entries = 342478
@bretdavidson
bretdavidson / gist:3442123
Created August 23, 2012 21:32 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@bretdavidson
bretdavidson / JSLint Options Descriptions
Last active October 5, 2018 22:37 — forked from dannygarcia/SublimeLinter.sublime-settings
Sublime Linter User Settings
anon true, if the space may be omitted in anonymous function declarations
bitwise true, if bitwise operators should be allowed
browser true, if the standard browser globals should be predefined
cap true, if upper case HTML should be allowed
continue true, if the continuation statement should be tolerated
css true, if CSS workarounds should be tolerated
debug true, if debugger statements should be allowed
devel true, if logging should be allowed (console, alert, etc.)
eqeq true, if == should be allowed
es5 true, if ES5 syntax should be allowed