Skip to content

Instantly share code, notes, and snippets.

@paulgoetze
paulgoetze / cities.ex
Last active August 18, 2019 19:22
Compiling an extensive cities list from free geonames.org data
# This module provides a function to compile city data using the free data
# provided on http://download.geonames.org/export/dump.
# It uses following files to compile a list of 4.4 mio. cities world-wide,
# including their name, state (administrative level 1), country, time zone,
# latitude, and longitude:
#
# * allCountries.txt (included in allCountries.zip)
# * countryInfo.txt
# * admin1CodesASCII.txt
#
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
hifi: Ember.inject.service(),
actions: {
play() {
const url = "https://stream.wqxr.org/wqxr";
const mimeType = 'audio/mpeg';
@paulgoetze
paulgoetze / plain_text.rb
Last active May 13, 2020 18:28
Plain text in Ruby
class PlainText
class << self
def write(&block)
return unless block_given?
@previous_line = current_line
@line = []
@paragraph = []
undefine_methods
@paulgoetze
paulgoetze / user.json
Last active April 29, 2022 10:32
Testing Your Python API App with JSON Schema - tests/support/schemas/user.json
// tests/support/schemas/user.json
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "User response schema",
"type": "object",
"properties": {
"data": {
"type": "object",
"properties": {