// Leaflet JS - note the *className* attribute
// [...]
L.tileLayer('https://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png', {
attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
className: 'map-tiles'
}).addTo(map);
// [...]| /* eslint-disable import/no-extraneous-dependencies */ | |
| const _ = require('lodash'); | |
| const fs = require('fs'); | |
| const eol = require('eol'); | |
| const path = require('path'); | |
| const VirtualFile = require('vinyl'); | |
| const flattenObjectKeys = require('i18next-scanner/lib/flatten-object-keys') | |
| .default; | |
| const omitEmptyObject = require('i18next-scanner/lib/omit-empty-object') | |
| .default; |
| # http://adventofcode.com/2017/day/1 | |
| defmodule Day1 do | |
| def sum1(digits), do: | |
| digits | |
| |> Stream.concat(Enum.take(digits, 1)) | |
| |> Stream.chunk_every(2, 1, :discard) | |
| |> Stream.filter(&match?([el, el], &1)) | |
| |> Stream.map(&hd(&1)) | |
| |> Enum.sum() |
I'm going to cover a simple, but effective, utility for managing state and transitions (aka workflow). We often need to store the state (status) of a model and it should only be in one state at a time.
- Publishing (Draft->Approved->Published->Expired->Deleted)
| # Written by Senko Rasic <senko.rasic@goodcode.io> | |
| # Released into Public Domain. Use it as you like. | |
| from django.db import models | |
| class SingletonModel(models.Model): | |
| """Singleton Django Model | |
| Ensures there's always only one entry in the database, and can fix the |
| #!/usr/bin/env python | |
| # | |
| # When triggered via a HTTP request, execute a command. | |
| # | |
| # Written by Senko Rasic <senko.rasic@goodcode.io> | |
| # Released into Public Domain. Use it as you like. | |
| # | |
| # Usage: python trigger.py <host> <port> <key> <command>... | |
| # | |
| # HTTP GET and POST requests are supported. If you need more verbs or need |
| account default | |
| host mail.messagingengine.com | |
| from myuser@mydomain.com | |
| auth on | |
| user username@fastmail.fm | |
| password password | |
| tls on | |
| tls_trust_file /usr/share/ca-certificates/mozilla/DigiCert_High_Assurance_EV_Root_CA.crt |
2217 Time Zone V (EST) 7 Nov. 1970--NTC-- "Pop's Place": I was polishing a brandy snifter when the Unmarried Mother came in. I noted the time---10:17 P. M. zone five, or eastern time, November 7th, 1970. Temporal agents always notice time and date; we must.
The Unmarried Mother was a man twenty--five years old, no taller than I am, childish features and a touchy temper. I didn't like his looks---I never had---but he was a lad I was here to recruit, he was my boy. I gave him my best barkeep's smile.
Maybe I'm too critical. He wasn't swish; his nickname came from what he always said when some nosy type asked him his line: "I'm an unmarried mother." If he felt less than murderous he would add: "at four cents a word. I write confession stories."
If he felt nasty, he would wait for somebody to make something of it. He had a lethal style of infighting, like a female cop---reason I wanted him. Not the only one.