Skip to content

Instantly share code, notes, and snippets.

View fuzz's full-sized avatar

Fuzz Leonard fuzz

  • Northern California
  • 09:33 (UTC -07:00)
View GitHub Profile
Moved to https://github.com/fuzz/crossplane-setup/blob/main/crossplane-setup.sh
There's a coder who's sure
All that glitters is gems
And she's writing a stairway to main:Object heaven
When she gets there she knows
If the blocks are all closed
She can return the last evaluated expression
Ooh ooh ooh
Ooh ooh ooh
And she's writing a stairway to main:Object heaven
@fuzz
fuzz / offerings.rb
Created April 18, 2020 03:26
Offerings
# migration
class CreateOfferings < ActiveRecord::Migration[6.0]
def change
create_table :offerings do |t|
t.references :product, foreign_key: true
t.references :vendor, foreign_key: true
# add other unique-to-vendor fields/associations
t.timestamps
end
@fuzz
fuzz / FilePathExist.hs
Last active July 31, 2019 19:33
Test if a FilePath--not its referent if a symbolic link--exists
import Control.Exception
import System.Posix.Files (FileStatus, getSymbolicLinkStatus)
filePathExist :: FilePath -> IO Bool
filePathExist fp = do
x <- try (getSymbolicLinkStatus fp) :: IO (Either IOError FileStatus)
case x of
Left _ -> return False
Right _ -> return True
{-