Skip to content

Instantly share code, notes, and snippets.

View veb's full-sized avatar
👋

Mike Mackenzie veb

👋
View GitHub Profile
@veb
veb / dunedin_weather_records_all_time.md
Created May 15, 2023 11:44
Dunedin weather records
Record Measurement Time and Date
Highest temperature 38.1°C 11:30, Feb 6 2011
Lowest temperature -7.5°C 08:19, Jul 13 2015
Highest gust 74.5km/h, 0.0° 15:01, May 24 2014
Highest rain rate 12mm/min 06:11, Oct 10 2019
Lowest barometer 968.4hPa 02:37, Jun 13 2022
Highest barometer 1038.8hPa 21:33, Jun 13 2020
Highest daily rainfall 174mm 23:50, Jun 3 2015
Highest hourly rainfall 27.7mm 14:01, Feb 1 2018
@veb
veb / dunedin_weather_records_may_2023.md
Last active May 15, 2023 11:45
Dunedin weather records for the month of May, 2023.
Records
Highest temperature 24.8°C
Lowest temperature 2.0°C
Highest gust 51.5km/h, 177.0°
Highest rain rate 0.6mm/min
Lowest barometer 982.3hPa
Highest barometer 1027.5hPa
Highest daily rainfall 13mm
Highest hourly rainfall 10.2mm
import web, sys, os, subprocess, uuid
from opencv.cv import *
from opencv.highgui import *
from shutil import copy
def detectObjects(image, imagefile):
grayscale = cvCreateImage(cvSize(image.width, image.height), 8, 1)
cvCvtColor(image, grayscale, CV_BGR2GRAY)
storage = cvCreateMemStorage(0)
import React, { useState, useEffect } from 'react'
import { formatNumber } from "libphonenumber-js";
import { Image, View, TextInput } from 'react-native';
const App = ({ placeholder, onChange, confirm }) => {
const [phoneNumber, setPhoneNumber] = useState('');
useEffect(() => {
let tempPhone = phoneNumber.replace(/\+/g, '');
let removeSpaces = tempPhone.replace(/ /g, '');
@veb
veb / app.js
Created October 28, 2017 20:50
Phone twig filter for twigjs/express
// ... app.js stuff
Twig.extendFilter("phone", function(value) {
var value = "" + value;
return value.replace(/(\d{1})(\d{4})(\d{3})/, "0$1-$2-$3");
});

Keybase proof

I hereby claim:

  • I am veb on github.
  • I am veb (https://keybase.io/veb) on keybase.
  • I have a public key ASAqE1ZzEPHq362mr3h5s31JkaZDP4J-X_ik3FcaDnorZAo

To claim this, I am signing this object:

@veb
veb / scraper.js
Created August 26, 2017 09:02
Scrapes the main page of HackerNews and returns an array of objects using Puppeteer and Cheerio
const puppeteer = require('puppeteer');
const cheerio = require('cheerio');
async function run() {
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto('https://news.ycombinator.com');
let content = await page.content();
var $ = cheerio.load(content);
@veb
veb / openports.sh
Created May 2, 2016 15:40
open ports in iptables bash
#!/bin/bash
# @author Mike Mackenzie (veb)
# @version 1.0
clear
echo ''
echo ''
if [ -z "$@" ]
then
mike@moar-bacon:~$ traceroute 163.47.21.74
traceroute to 163.47.21.74 (163.47.21.74), 30 hops max, 60 byte packets
1 192.168.0.1 (192.168.0.1) 0.250 ms 0.314 ms 0.430 ms
2 * * *
3 100.70.120.1 (100.70.120.1) 27.242 ms 27.317 ms 27.680 ms
4 * * *
5 * * *
6 122.56.60.71 (122.56.60.71) 28.639 ms 27.589 ms 27.499 ms
7 g2-0-3-549.tkcr4.global-gateway.net.nz (122.56.118.97) 27.376 ms 27.422 ms 27.415 ms
8 ae9-42.akcr11.global-gateway.net.nz (122.56.127.33) 28.101 ms ae10-43.akcr11.global-gateway.net.nz (122.56.127.61) 27.961 ms ae9-44.akcr11.global-gateway.net.nz (122.56.127.209) 28.081 ms
@veb
veb / keybase.md
Last active December 28, 2015 03:05

Keybase proof

I hereby claim:

  • I am veb on github.
  • I am veb (https://keybase.io/veb) on keybase.
  • I have a public key whose fingerprint is D430 D7FC 81A8 BE8F 8C0B 0D0F B872 5958 9393 28C5

To claim this, I am signing this object: