Skip to content

Instantly share code, notes, and snippets.

View chagoy's full-sized avatar

a c chagoy

  • Los Angeles, CA
View GitHub Profile
@chagoy
chagoy / gist:cd659fe23bb95199217d51bb2911211e
Created May 21, 2018 18:18
request and response drills
madlib
https://glitch.com/edit/#!/merciful-handsaw?path=server.js:22:31
echo
https://glitch.com/edit/#!/deserted-unicorn?path=server.js:7:2
1
SELECT * FROM restaurants;
2
SELECT * FROM restaurants WHERE cuisine='Italian';
3
SELECT id, name FROM restaurants WHERE cuisine='Italian' LIMIT 10;
4
SELECT count(*) FROM restaurants WHERE cuisine='Thai';
5
SELECT count(*) FROM restaurants;
//find a command that retrieves all restaurants
db.restaurants.find({})
//limit and sort, alphabetize, take 10
db.restaurants.find().sort({name: 1}).limit(10)
//get by id
var objectId = db.restaurants.findOne({}, {_id: 1})._id
db.restaurants.find({_id: objectId})
https://waiting-interest.glitch.me/
https://scythe-button.glitch.me
https://road-earth.glitch.me/
https://ludicrous-aftershave.glitch.me/
https://fish-vault.glitch.me/
glitch.com/edit/#!/deserted-marsupial
https://glitch.com/edit/#!/few-koala
@chagoy
chagoy / gist:d9e0fa2588044c26abb62282cb01daa9
Created August 23, 2018 20:03
return from Ticketmaster
{
"_embedded": {
"events": [
{
"name": "Aubrey And The Three Amigos Tour",
"type": "event",
"id": "Z7r9jZ1AeC7A6",
"test": false,
"url": "http://www.ticketsnow.com/InventoryBrowse/TicketList.aspx?PID=2384147",
@chagoy
chagoy / gist:895197adca22f2df973293324b645c6f
Last active May 27, 2020 15:02
exposing apex rest service
public class helloRest{
public static String whatTimeIsIt(){
return system.now().format();
}
}
public class test {
public static string okThen() {
return 'alright';
}
@chagoy
chagoy / Zip Codes to DMAs
Created October 1, 2025 15:55 — forked from clarkenheim/Zip Codes to DMAs
TSV file containing zip codes and the DMA they fall in to. Method: calculate the centre point of every zip code geo boundary, plot those points on a DMA boundary map, find the containing DMA of each zip centroid
This file has been truncated, but you can view the full file.
zip_code dma_code dma_description
01001 543 SPRINGFIELD - HOLYOKE
01002 543 SPRINGFIELD - HOLYOKE
01003 543 SPRINGFIELD - HOLYOKE
01004 543 SPRINGFIELD - HOLYOKE
01005 506 BOSTON (MANCHESTER)
01007 543 SPRINGFIELD - HOLYOKE
01008 543 SPRINGFIELD - HOLYOKE
01009 543 SPRINGFIELD - HOLYOKE
01010 543 SPRINGFIELD - HOLYOKE