Skip to content

Instantly share code, notes, and snippets.

View MilesMcBain's full-sized avatar

Miles McBain MilesMcBain

  • Queensland Fire and Emergency Services
  • Brisbane, Queensland
View GitHub Profile
@coltenkrauter
coltenkrauter / fix-wsl2-dns-resolution
Last active April 24, 2024 17:00
Fix DNS resolution in WSL2
More recent resolution:
1. cd ~/../../etc (go to etc folder in WSL).
2. echo "[network]" | sudo tee wsl.conf (Create wsl.conf file and add the first line).
3. echo "generateResolvConf = false" | sudo tee -a wsl.conf (Append wsl.conf the next line).
4. wsl --terminate Debian (Terminate WSL in Windows cmd, in case is Ubuntu not Debian).
5. cd ~/../../etc (go to etc folder in WSL).
6. sudo rm -Rf resolv.conf (Delete the resolv.conf file).
7. In windows cmd, ps or terminal with the vpn connected do: Get-NetIPInterface or ipconfig /all for get the dns primary and
secondary.
library(tidyverse)
library(sf)
library(mapview)
library(furrr)
library(raster)
plan(multiprocess)
ex = extent(c(xmin=-112,xmax=155,ymin=-44,ymax=-10))
# This example simulates a stock price 1 time and 10k times.
# It uses a functional approach and a loop approach.
# A speed test is done at the end.
# This example for GBM ignores the fact that
# 1) There is an explicit solution to GBM where simulation isn't needed
# 2) Along the same lines, there is a vectorized form where pure matrix mult can be used.
# These are ignored for the sake of the example, because there are often cases
# where this isn't the case and you HAVE to do the discrete loop.
@jimjam-slam
jimjam-slam / rmd-snippets.json
Created February 22, 2018 23:15
Visual Studio Code snippets for working with RMarkdown files. Go to Configure User Snippets and drop it in.
{
// Snippets for talking to yourself
"TK (citation needed)": {
"prefix": "tkcite",
"body": "_(**TKTK** - citation needed)_",
"description": "Add a note to yourself to cite this later."
},
"TK": {
"prefix": "tktk",
"body": "_(**TKTK** - blah blah blah)_",
@hofmannsven
hofmannsven / README.md
Created December 6, 2017 00:32
Increase key repeat rate on macOS

Increase key repeat rate on macOS

Settings: System Preferences » Keyboard » Key Repeat/Delay Until Repeat

Use the commands below to increase the key repeat rate on macOS beyond the possible settings via the user interface. The changes aren't applied until you restart your computer.

Source: https://apple.stackexchange.com/a/83923

@fernandojsg
fernandojsg / gltf_bookmarklet.js
Last active September 1, 2017 13:54
THREE.js and AFRAME glTF exporter bookmarklet
javascript:(function(){
var link = document.createElement( 'a' ); link.style.display = 'none'; document.body.appendChild( link );
function save( blob, filename ) { link.href = URL.createObjectURL( blob ); link.download = filename; link.click(); }
function saveString( text, filename ) { save( new Blob( [ text ], { type: 'application/json' } ), filename );}
var script=document.createElement('script');
script.src='https://threejs.org/examples/js/exporters/GLTFExporter.js';
script.onload = function () {
var exporter = new THREE.GLTFExporter();
@byronmejia
byronmejia / QUT Horizon Guide.md
Last active October 19, 2022 06:48
A QUT Student's guide to the Horizon (client).

VMware Horizon Client Tutorial

Sometimes, it's necessary to try and connect to the QUT computers as a student, whether it be for using certain proprietary software, certain environments, or beefier computers?

This guide assumes you are not on campus and require a VPN client (Virtual Private Network) to behave as if you are at QUT.

#devtools::install_github('rstudio/leaflet')
library(leaflet)
library(raster)
## fake a raster
r <- raster(volcano)
## this volcano is in NZ, but we are ignoring that with huge abandon
extent(r) <- extent(100, 150, -42, -15)
projection(r) <- "+init=epsg:4326"