Skip to content

Instantly share code, notes, and snippets.

View hectcastro's full-sized avatar

Hector Castro hectcastro

View GitHub Profile
@mislav
mislav / workflows-automerge.yml
Last active August 19, 2024 15:40
Using GitHub CLI from GitHub Actions
name: Auto-merge
on:
pull_request:
types: [opened]
jobs:
automerge:
runs-on: ubuntu-latest
@ChristopherA
ChristopherA / brew-bundle-brewfile-tips.md
Last active September 25, 2024 01:37
Brew Bundle Brewfile Tips

Brew Bundle Brewfile Tips

Copyright & License

Unless otherwise noted (either in this file or in a file's copyright section) the contents of this gist are Copyright ©️2020 by Christopher Allen, and are shared under spdx:Creative Commons Attribution Share Alike 4.0 International (CC-BY-SA-4.) open-source license.

Sponsor

If you more tips and advice like these, you can become a monthly patron on my GitHub Sponsor Page for as little as $5 a month; and your contributions will be multipled, as GitHub is matching the first $5,000! This gist is all about Homebrew, so if you like it you can support it by donating to them or becoming one of their Github Sponsors.

nflfastR Python Guide

August 2021: This serves as the first refresh of this guide. My hope is that this guide is a constant work in progress, receiving updates as I receive requests and discover new things myself. This update features more data visualization examples and a more detailed filtering section. I've also posted all relevant code in the guide to github in a Jupyter Notebook, found here.

This guide serves as an update to my original nflscrapR Python Guide. As of 2020, nflscrapR is defunct and nflfastR has taken its place. As the name implies, the library has made the process of scraping new play by play data much faster.

Using Jupyter Notebooks or Jupyter Lab, which come pre-installed with Anaconda is typically the best way to work with

@denniswebb
denniswebb / userdata_i3_8x.sh
Created April 16, 2017 19:04
Userdata for configuring RAID0 on AWS i3.8xlarge
#!/usr/bin/env bash
mkdir -p /data
mdadm --create --verbose --level=0 /dev/md0 --name=DATA --raid-devices=4 /dev/nvme0n1 /dev/nvme1n1 /dev/nvme2n1 /dev/nvme3n1
mdadm --wait /dev/md0
mkfs.ext4 /dev/md0
mdadm --detail --scan >> /etc/mdadm.conf
dracut -H -f /boot/initramfs-$(uname -r).img $(uname -r)
echo /dev/md0 /data ext4 defaults,nofail,noatime,discard 0 2 >> /etc/fstab
mount -a
@shershen08
shershen08 / typescript-strategy-and-factory-patterns.ts
Last active October 19, 2022 17:08
Strategy and factory patterns in TypeScript
// see article with examples in JAVA here: https://dzone.com/articles/design-patterns-the-strategy-and-factory-patterns
// example for educational purposes shownig close and mature syntax of modern TypeScript
enum AccountTypes {CURRENT, SAVINGS, HIGH_ROLLER_MONEY_MARKET, STANDARD_MONEY_MARKET}
////////////////////////////////////////
/// the interface that is used by the strategy
////////////////////////////////////////
interface InterestCalculationStrategy {

Getting Started in Scala

This is my attempt to give Scala newcomers a quick-and-easy rundown to the prerequisite steps they need to a) try Scala, and b) get a standard project up and running on their machine. I'm not going to talk about the language at all; there are plenty of better resources a google search away. This is just focused on the prerequisite tooling and machine setup. I will not be assuming you have any background in JVM languages. So if you're coming from Python, Ruby, JavaScript, Haskell, or anywhere…  I hope to present the information you need without assuming anything.

Disclaimer It has been over a decade since I was new to Scala, and when I was new to Scala, I was coming from a Java and Ruby background. This has probably caused me to unknowingly make some assumptions. Please feel free to call me out in comments/tweets!

One assumption I'm knowingly making is that you're on a Unix-like platform. Sorry, Windows users.

Getting the JVM

@jpluscplusm
jpluscplusm / .gitignore
Last active September 17, 2016 00:03
Terraform Makefile wrapper with remote state mgmt/bootstrap
/.terraform/terraform.tfstate*
/plan.out
/.plan.out.*
@imbriaco
imbriaco / 01-main.tf
Last active June 8, 2016 22:16
I'll take stupid Terraform tricks for $500, Alex
module "my_instance" {
source = "../path/to/crazy_module.tf"
...
count = 1
include_eip = "true"
}
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.
@irgeek
irgeek / README.md
Last active December 10, 2021 16:42
Finding AMIs after building an image with Packer

Finding Packer-generated AMIs automatically after builds

The basic technique is to have Packer add a tag with a unique value during the build, and use AWS' built-in filtering capabilities to find that specific AMI after the build finishes.

  • template.json - Shows the settings that need to be added to your template
  • build.sh - Shows how to use the template to do a build and retrieve the AMI information