Skip to content

Instantly share code, notes, and snippets.

@jueyang
jueyang / geocoder.js
Created December 2, 2012 20:29
geocoder
$(input).keydown(function (e) {
var value = $(this).val();
if (value.length > 3) {
_.debounce(goGeo(value), 300);
}
var query = $(this).val();
goGeo(query);
});
@jueyang
jueyang / index
Created May 29, 2012 16:30
when to use tooltip
case 'tooltips':
MM_map.interaction = wax.mm.interaction()
.map(MM_map)
.tilejson(t)
.on({on:function(o)
if (l.api=='http://a.tiles.mapbox.com/v3/djohnson.icc-situations,mapbox.world-borders-dark.jsonp') {
wax.tooltip()
.parent(MM_map.parent)
.events()
);
@jueyang
jueyang / MB.layers
Created May 10, 2012 20:40
multiple layer switchers?
new MB.layers('none', 'map', [
{
name: '',
id: 'jue.map-9izw3s28',
el: 'now',
layer: 1,
center: {
lat: -2,
lon: 17,
zoom: 3,
@jueyang
jueyang / MB.layers
Created May 10, 2012 20:40
multiple layer switchers?
new MB.layers('none', 'map', [
{
name: '',
id: 'jue.map-9izw3s28',
el: 'now',
layer: 1,
center: {
lat: -2,
lon: 17,
zoom: 3,
@jueyang
jueyang / question MB.layers
Created May 4, 2012 19:37
How do i make the switcher and the in-text link independent from each other?
MB.layers = function(switcher, m, layers) {
$.each(layers, function(i, l) {
if (l.el) {
$('#' + l.el)
.click(function(e) {
e.preventDefault();
//('#' + switcher + ' .layer').removeClass('active');
$(this).addClass('active');
MB.refresh(m, l);
});
@jueyang
jueyang / Flickr MM example
Created April 25, 2012 18:52
display image from flickr non-geographically and geographically
Question:
In the MM flickr example, the photos are displayed on load. However, I'd like to turn the whole flickr thing into a function that can be fired with a click on the page.
Original MM example (see changes/thought process in the next chunk):
var MM = com.modestmaps;
var provider = new MM.Layer(new MM.BlueMarbleProvider());
@jueyang
jueyang / QW expand
Created April 24, 2012 14:18
from quitewrite
mv: function(tp, h, nu, ind, ob) { // Collapse / Expand
var t = this;
if (t.ii[ind]) {
if (!nu) {
t.ii[ind].style.overflow = 'hidden';
}
t.p.$(t.ii[ind]).animate({
top: tp,
height: h
}, 800, null, function() {

Locations:

  • The old NY Daily News Building (until 1995)
  • The site of the old Biograph Studios
  • The Jacob Riis Neighborhood Settlement House
  • The site of the Lion's Head
  • Black Rock
  • NY1
  • Current offices of the NY Daily News
  • Current offices of The New York Post
  • BuzzFeed

The 1st CUNY J-School New York Journalism History Hunt!

Your mission

Locate as many of the journalism-related sites from this list.

Instructions

$insert = "INSERT INTO spider_count (spider, tally) SELECT 'Googlebot', 1";
$upsert = "UPDATE spider_count SET tally=tally+1 WHERE date='today' AND spider='Googlebot'";
WITH upsert AS ($upsert RETURNING *) $insert WHERE NOT EXISTS (SELECT * FROM upsert);
--- expanded
WITH upsert AS (
UPDATE spider_counts
SET tally=tally+1
WHERE date='today' AND spider='Googlebot'