Skip to content

Instantly share code, notes, and snippets.

View wjgilmore's full-sized avatar

Jason Gilmore wjgilmore

View GitHub Profile

Keybase proof

I hereby claim:

  • I am wjgilmore on github.
  • I am wjgilmore (https://keybase.io/wjgilmore) on keybase.
  • I have a public key ASDtE66eymWX3pxHjIWUEvFrVckO5_Txmj3bUKveIkOZOgo

To claim this, I am signing this object:

{
"swagger": "2.0",
"info": {
"version": "1.0",
"title": "U.S.Energy Information Administration Swagger",
"description": "U.S.Energy Information Administration API services",
"license": {
"name": "MIT",
"url": "http://github.com/gruntjs/grunt/blob/master/LICENSE-MIT"
}
@wjgilmore
wjgilmore / us-states
Created June 10, 2014 17:45
U.S. states for Rails db/seeds.rb file
State.create([
{ :name => 'Alabama', :abbreviation => 'AL'},
{ :name => 'Alaska', :abbreviation => 'AK'},
{ :name => 'Arizona', :abbreviation => 'AZ'},
{ :name => 'Arkansas', :abbreviation => 'AR'},
{ :name => 'California', :abbreviation => 'CA'},
{ :name => 'Colorado', :abbreviation => 'CO'},
{ :name => 'Connecticut', :abbreviation => 'CT'},
{ :name => 'Delaware', :abbreviation => 'DE'},
{ :name => 'District of Columbia', :abbreviation => 'DC'},
@wjgilmore
wjgilmore / active_record_gem_list
Last active August 29, 2015 13:57
A list of useful Active Record gems
Just a list of useful Active Record-related models.
### Acts as Taggable On
Adds tagging features to Active Record models
https://github.com/mbleigh/acts-as-taggable-on
### Acts_as_List
@wjgilmore
wjgilmore / neo4j_basic_queries
Last active November 10, 2020 09:04
Neo4j query examples
#######
# GENERAL NOTES
#######
* Node labels are case-sensitive. Customer and customer are different!
* Relationship names are case-sensitive. OWNS and owns are different!
* You can create nodes/relationships iff they don't exist using UNIQUE: http://docs.neo4j.org/chunked/snapshot/query-create-unique.html.
#######
# ADMIN QUERIES
@wjgilmore
wjgilmore / csv_to_associative_array.php
Created January 19, 2012 13:39
Convert two column csv file to an associative array
<?php
$csvFile = "file.csv";
if (($handle = fopen($csvFile, "r")) !== FALSE) {
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
printf("'%s' => '%s',\n", $data[0], $data[1]);
}
fclose($handle);
}
$<
lines = $GEDIT_SELECTED_TEXT.split("\n")
output = ""
lineNumber = 1
for line in lines:
output += str(lineNumber).zfill(2) + " " + line + "\n"
lineNumber += 1
return output
>