Skip to content

Instantly share code, notes, and snippets.

@russelldavies
russelldavies / agp_wifi.py
Created December 26, 2014 15:13
Malaga airport free wifi
# -*- coding: utf-8 -*-
import random
import requests
def random_mac():
return ''.join(('%02x' % i for i in [
0x00, 0x16, 0x3e,
random.randint(0x00, 0x7f),
@russelldavies
russelldavies / okc.py
Created May 5, 2015 12:35
OK Cupid Questions
"""
Script to find out when a person answered their questions on OK Cupid.
For some reason OKC displays when someone has answered a question when you
answer the same question in relation to their profile.
Kind of useless but interesting to see that most people insomniacs.
"""
from datetime import datetime
from functools import partial
@russelldavies
russelldavies / dsl_stats.gpi
Last active October 13, 2016 16:28
Connection Health
set terminal png enhanced size 1200,675 linewidth 2
set output 'dsl_stats.png'
set title 'DSL Stats'
set autoscale fix
set grid
set datafile separator ','
set key autotitle columnhead
set xlabel 'Timestamp (UTC)'
@russelldavies
russelldavies / keybase.md
Created February 23, 2017 01:52
keybase.md

Keybase proof

I hereby claim:

  • I am russelldavies on github.
  • I am russelldavies (https://keybase.io/russelldavies) on keybase.
  • I have a public key whose fingerprint is 8F53 80D1 15B4 BD2D 58CA C847 DA4B 04BC 5CE0 B6FE

To claim this, I am signing this object:

@russelldavies
russelldavies / anagrams.elm
Last active March 13, 2018 21:31
Anagram Solver
module Main exposing (..)
import Char
import Dict exposing (Dict)
createMap : String -> Dict Int (List String) -> Dict Int (List String)
createMap word dict =
let
key =
module Lcd exposing (main)
import Html exposing (Html, div, input)
import Html.Events exposing (onInput)
import Svg exposing (..)
import Svg.Attributes exposing (..)
import List.Extra exposing (zip)
import Array exposing (Array)
import Maybe.Extra
@russelldavies
russelldavies / buildspec.yml
Created April 4, 2019 18:23
Zappa AWS CodeBuild
version: 0.2
phases:
install:
commands:
- virtualenv venv
- source venv/bin/activate
- pip install -r requirements.txt
pre_build:
commands:
@russelldavies
russelldavies / lambda_function.py
Created July 31, 2019 15:19
AWS Lambda Slack Notify
import boto3
import json
import logging
import os
from urllib.request import Request, urlopen, URLError, HTTPError
HOOK_URL = os.environ['HOOK_URL']
SLACK_CHANNEL = os.environ['SLACK_CHANNEL']
@russelldavies
russelldavies / Cognito.elm
Created August 20, 2019 12:47
AWS Cognito in Elm
port module Cognito exposing
( DeliveryDetails
, Event(..)
, MfaDetails
, changePassword
, completeNewPassword
, confirmSignIn
, forgotPassword
, forgotPasswordSubmit
, listen
@russelldavies
russelldavies / Select.elm
Created April 29, 2020 14:35
Select in Elm with optional clear
module Main exposing (main)
import Browser
import Html exposing (..)
import Html.Attributes as Attributes
import Html.Events as Events
import Json.Decode as Decode
import List.Extra as List