Skip to content

Instantly share code, notes, and snippets.

@eeeschwartz
eeeschwartz / datapackage-ckan-index.js
Created February 19, 2015 03:28
CKAN dpm module that will datastore_upsert data rather than deleting the resource and re-inserting
var fs = require('fs')
, path = require('path')
, CKAN = require('ckan')
, parse = require('csv-parse')
, dpRead = require('datapackage-read')
;
var Pusher = function(ckanInstance, apiKey) {
this.client = new CKAN.Client(ckanInstance, apiKey);
};
/*
Bootstrap 3.1.1 namepaced to .tw-bs
E.g.
<table>
// my regular table
</table>
<div class="tw-bs">
<table>
<a href="javascript:void(function () {
var jsCode = document.createElement('script');
jsCode.setAttribute('src', 'https://gist.githubusercontent.com/eeeschwartz/316c5d13bba5b1e6cd8f/raw/main.js');
document.body.appendChild(jsCode);
}())">Extract Qs</a>
require 'spec_helper'
describe Book do
it "has same join behavior for logically equivalent subqueries" do
author = Author.create
book = Book.create!(cost: 100, author: author)
2.times { Chapter.create!(book: book) }
sub_query1 = Book.arel_table[:author_id].in([author.id])
sub_query2 = Book.arel_table[:author_id].in(
set nocompatible
set viminfo='20,\"500 " Keep a .viminfo file.
" When editing a file, always jump to the last cursor position
autocmd BufReadPost *
\ if ! exists("g:leave_my_cursor_position_alone") |
\ if line("'\"") > 0 && line ("'\"") <= line("$") |
\ exe "normal g'\"" |
\ endif |
@eeeschwartz
eeeschwartz / lexington-geocoder.html
Last active January 8, 2016 20:17
Use esri-leaflet to geocode against Lexington's ArcGISOnline API
<!DOCTYPE html>
<html>
<head>
<title>Esri Leaflet Geocoder</title>
<!-- Load Leaflet from CDN-->
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-1.0.0-b1/leaflet.css" />
<script src="http://cdn.leafletjs.com/leaflet-1.0.0-b1/leaflet.js"></script>
<!-- Esri Leaflet -->
<script src="//cdn.jsdelivr.net/leaflet.esri/2.0.0-beta.6/esri-leaflet.js"></script>
<!-- Esri Leaflet Geocoder -->
@eeeschwartz
eeeschwartz / .gitignore
Last active May 23, 2016 19:57
Javascript-based redirects from lexingtonky.gov to next.lexingtonky.gov
node_modules/*
@eeeschwartz
eeeschwartz / index.html
Last active May 24, 2016 21:08
Lexington address autocomplete
<html>
<head>
<meta charset=utf-8 />
<title>Searching map services</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<!-- Load Leaflet from CDN-->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/leaflet/1.0.0-rc.1/leaflet.css" />
<script src="https://cdn.jsdelivr.net/leaflet/1.0.0-rc.1/leaflet-src.js"></script>
@eeeschwartz
eeeschwartz / index.html
Last active July 21, 2016 18:08
List of meetings to scrape
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- saved from url=(0041)http://lexingtonky.gov/index.aspx?page=17 -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<body>
<table id="_ctl0_listPanel" cellpadding="0" cellspacing="0" border="0" width="100%"><tbody><tr><td>
<div id="_ctl0_TableDiv" class="calendar_allinone">
<table class="listtable" cellspacing="0" rules="all" border="1" id="_ctl0_listDataGrid">
<tbody><tr class="listtable_header">
@eeeschwartz
eeeschwartz / boards-commissions.html
Last active July 23, 2016 21:14
Temp dump of boards and commissions
<div>
<div class="views-element-container contextual-region lex-block" id="block-views-block-department-directory-block-1">
<div>
<div class="contextual-region js-view-dom-id-85ba88981e23a376726877467b3bea3cb0cb9d97d2d5cd2d95946dca49f74772">
<div class="usa-unstyled-list">
<ul class="list lex-card-title lex-card-title-medium">
<li class="lex-filter-item lex-card"><span class="js-lex-filter-item "><a href="http://localhost:5000/index.aspx@page=2440.html">Administrative Hearing Board</a></span></li>
<li class="lex-filter-item lex-card"><span class="js-lex-filter-item "><a href="http://localhost:5000/index.aspx@page=3483.html">Affordable Housing Governing Board</a></span></li>
<li class="lex-filter-item lex-card"><span class="js-lex-filter-item "><a href="http://localhost:5000/index.aspx@page=2441.html">Agricultural Extension District Board</a></span></li>
<li class="lex-filter-item lex-card"><span class="js-lex-filter-item "><a href="http://www.bluegrassairport.com/administration.html">Airport Board</a></sp