Skip to content

Instantly share code, notes, and snippets.

<#
.SYNOPSIS
Check internet connection by pinging a list of remote and local servers
#>
# Local gateway recommended
$localServers = @("192.168.1.1")
# Remote servers to ping
$remoteServers = @(
// Presses F15 every 30 seconds to keep a computer awake
// Tested on an Arduino Micro
#include <Keyboard.h>
void setup() {
// Initialize digital pin LED_BUILTIN as an output.
pinMode(LED_BUILTIN, OUTPUT);
// Initialize keyboard library
// Special control variable for the number of facets used to generate an arc
$fn = 100;
// Radius of the corner in mm
radius = 10;
// Thickness of the sander guide
frameThickness = 3;
// Length of the sander guide
frameExtension = 15;
# Probably ~90% correct
# Be sure to update the line that sets MatchingAssets to whatever requirement you need
# Only downloads the first asset in MatchingAssets
jobname:
steps:
- name: Download latest
id: download
shell: pwsh
run: |
@danclien
danclien / percona-toolkit-man-pages.txt
Created December 11, 2018 14:50
Percona Toolkit - 20181211
PERCONA-TOOLKIT(1p) User Contributed Perl Documentation PERCONA-TOOLKIT(1p)
NAME
percona-toolkit - Advanced command-line tools for MySQL
DESCRIPTION
Percona Toolkit is a collection of advanced command-line tools used by Percona (<http://www.percona.com/>)
support staff to perform a variety of MySQL and system tasks that are too difficult or complex to perform
manually.

Random thoughts on sets

Sets can be generalized as a function that takes an argument and returns true or false.

Sets of numbers

For a specific set of numbers, you can write it as:

const mySetOfNumbers = num => [1,2,3,4,5].includes(num);
#!/usr/bin/env stack
{-
stack
script
--resolver lts-11.0
--ghc-options -Wall
-}
{-# LANGUAGE RankNTypes #-}
#!/usr/bin/env stack
{-
stack
script
--resolver lts-11.0
--ghc-options -Wall
-}
{-# LANGUAGE RankNTypes #-}
@danclien
danclien / Order.hs
Last active March 11, 2018 19:16 — forked from bohde/Order.hs
Example of Haskell code I see under tested a lot
module Order where
-- DBM is some Monad Transformer stack that allows us to talk to our DB (also a form of DI!)
placeOrder :: User -> OrderDetails -> DBM ()
placeOrder user details = do
-- Some users will have discounts for
(discount :: Maybe Discount) <- findRelevantDiscount user details
-- Create the specific order for this user with any discount

Keybase proof

I hereby claim:

  • I am danclien on github.
  • I am dacali (https://keybase.io/dacali) on keybase.
  • I have a public key ASB68y7Zzicg_WuGVSFBKmvMHFd4xfHwbRG9qSI-VMfZJgo

To claim this, I am signing this object: