Skip to content

Instantly share code, notes, and snippets.

@greghaskins
greghaskins / Microsoft Entra SSO in Firefox on macOS.md
Last active May 5, 2025 14:33
Enable Microsoft Entra SSO with Firefox for corporate Single-Sign-On on macOS

Enable Microsft Entra SSO in Firefox on macOS

Microsoft Intune / "Company Portal" integrates with the macOS system-wide SSO mechanism. Beyond just single-sign-on, this also helps the Microsoft-hosted websites (such as SharePoint and OneDrive) verify that the device is "trusted" so you don't get the annoying non-compliance banner:

Your organization doesn't allow you to download, print, or sync using this device

In Microsoft Edge (unsuprisingly) and Safari, this "just works." In Chrome, you can use the official browser extension. Firefox requires a policy settings change that isn't obvious since it's not in the UI.

Details

@greghaskins
greghaskins / Raffle script
Last active May 1, 2019 13:54
raffle.py: Randomly choose N unique entries from a list
We couldn’t find that file to show.

Keybase proof

I hereby claim:

  • I am greghaskins on github.
  • I am greghaskins (https://keybase.io/greghaskins) on keybase.
  • I have a public key whose fingerprint is 4329 89C3 6CDF 6718 BC11 ECA5 AA62 945D 5436 43DD

To claim this, I am signing this object:

You can trigger a GitHub Pages (Jekyll) rebuild with a single API call. This is pretty useful for auto-publishing blog posts from a bot like Zapier in conjunction with future: false in your Jekyll config.yml. Just future-date your posts, and they'll go live when that date rolls around. I use a version of this setup for my blog at greghaskins.com.

Setup

  1. Create a GitHub personal access token and save it somewhere. It needs to have the repo access scope (at least).

  2. Create a file at the root of your repo (e.g. .publish) with some dummy content.

    $ echo ".publish" > .publish
@greghaskins
greghaskins / fizzbuzz.R
Last active August 29, 2015 14:01
FizzBuzz kata written as an R function. Logic implemented with array subsetting instead of loops.
fizzbuzz <- function(){
input <- seq(1, 100)
result <- input
result[input %% 3 == 0] <- "Fizz"
result[input %% 5 == 0] <- "Buzz"
result[input %% 15 == 0] <- "FizzBuzz"
result
}
fizzbuzz()
@greghaskins
greghaskins / ruby_quick_intro.rb
Last active August 29, 2015 14:01
Quick reference for getting started with Ruby. Useful for people doing katas, etc. with some programming knowledge but no Ruby experience.
# These are some useful tips for programming in Ruby
# (Things in ALL_CAPS will be written by you)
# Comments begin with a "#" like this
# A test method
def test_SOMETHING
assert_equal EXPECTED_VALUE, ACTUAL_VALUE
end