Skip to content

Instantly share code, notes, and snippets.

View marknorgren's full-sized avatar

Mark Norgren marknorgren

View GitHub Profile
protocol A {
static func doSomething() -> String
static func aFuncWith(param: String) -> String
}
extension A {
static func aFuncWith(param: String = "default") -> String {
return param
}
}

{{monday:YYYY-MM-DD}} - {{friday:YYYY-MM-DD}}

Fri {{friday:M-DD}}

Thurs {{thursday:M-DD}}

@marknorgren
marknorgren / wordle.md
Created February 2, 2022 16:18 — forked from huytd/wordle.md
Wordle in less than 50 lines of Bash

image

How to use:

./wordle.sh

Or try the unlimit mode:

Keybase proof

I hereby claim:

  • I am marknorgren on github.
  • I am marknorgren (https://keybase.io/marknorgren) on keybase.
  • I have a public key ASAE4AxlqVuu3BAYyrAdFhSoslvvk-uo6II_RgOFrr2_Rwo

To claim this, I am signing this object:

@marknorgren
marknorgren / ambientweather_telegraf.md
Created July 4, 2020 16:06 — forked from dhowland/ambientweather_telegraf.md
Telegraf config for AmbientWeather API

This is the most straightforward config for parsing the Ambient Weather API into a time series database with Telegraf. I use InfluxDB to store the data and Grafana to view the data.

Note that this is not a complete Telegraf config. What follows is a fragment that you would add to the bottom of your telegraf.conf file. You must set up Influx yourself.

You MUST replace the xxxxxxxx strings in the urls parameter with your personal Application key and API key. See https://www.ambientweather.com/api.html for help if you don't have your keys.

The measurement name can be set to anything you want with the name_override parameter.

The devices endpoint gives data for all weather stations associated with your account, but this config simply takes the first one. This is done with the json_query = "0.lastData" line. Other devices could be selected by changing the 0 to another number. Properly handling multiple weather stations is too complex for any sane config of the http plugin for Telegraf. Hard

Keybase proof

I hereby claim:

  • I am mrkd on github.
  • I am mrkd (https://keybase.io/mrkd) on keybase.
  • I have a public key ASDOOYzl6TugBGqwQxaUGJz2mHAbA-9pBvED2ZZ5G815ywo

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am mrkd on github.
  • I am mrkd (https://keybase.io/mrkd) on keybase.
  • I have a public key ASCwnADjCeJ3Cv5fyxI9yXltY7KJcL-zsdSSvva0Wk4_dQo

To claim this, I am signing this object:

@marknorgren
marknorgren / grab links.bookmarklet
Last active April 25, 2017 16:11 — forked from ttscoff/grab links.bookmarklet
Create a bookmark and paste the code from `grab links.bookmarklet` into the url. Trigger it on a page containing links you want to save and then click the section of the page containing the links. A Markdown list of all links will be generated, and clicking the resulting list will select all for copying.
@marknorgren
marknorgren / git_talk.md
Last active February 11, 2018 00:13 — forked from tlberglund/gist:3208768
Live Log Script Git

$while true; do clear; tree -a; sleep 1; done

#!/bin/bash
while :
do
    clear
 git --no-pager log --graph --all --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative $1