Skip to content

Instantly share code, notes, and snippets.

View marknorgren's full-sized avatar

Mark Norgren marknorgren

View GitHub Profile
@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:

@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

@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
@marknorgren
marknorgren / minimal-vim.sh
Created March 31, 2016 00:18 — forked from subdigital/minimal-vim.sh
minimal vim setup for linux servers / vms + swift
#! /bin/bash
set -e
if [[ -f ~/.vimrc ]]
then
echo "You already have a ~/.vimrc. Aborting to avoid losing data..."
exit 1
fi
@marknorgren
marknorgren / index.html
Created July 23, 2015 18:19 — forked from anonymous/index.html
JS Bin javascript guid // source http://jsbin.com/movini
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="javascript guid">
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">

Looking for workshop teachers to teach on the following topics!

For introductions please tweet @frontendmasters, @1marc or email: marc at FrontendMasters.com. Thanks!

You can propose other topics too.

JavaScript

  • React.js Scheduled Ryan Florence Mar '15 / Flux
  • ES6 Recorded Aaron Frost
@marknorgren
marknorgren / drive.py
Last active August 29, 2015 14:07 — forked from basuke/drive.py
#
# python drive.py "origin" ["waypoint" ... ] "destination"
#
# i.e. python drive.py "Union Square, San Francisco" "Ferry Building, San Francisco" 'Bay Bridge' SFO
import sys, json, urllib2, md5, os.path, pprint
from math import radians, sin, cos, atan2, pow, sqrt
from urllib import quote_plus
from xml.sax.saxutils import escape
from optparse import OptionParser
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Chat</title>
<link rel="stylesheet" href="normalize.css">
</head>
<body>
<style>
td {

Introduction to Web Development

Schedule for Day 1

Time (CDT) Topic
8:30 Tech Check and Hello
9:00 Your coding toolbox: the Browser and Sublime Text 2/3
9:30 The basics of the web: it’s more than just tubes
10:00 HTML – What is markup, why do we have it, and the DOM