Skip to content

Instantly share code, notes, and snippets.

View fredoliveira's full-sized avatar

Fred Oliveira fredoliveira

View GitHub Profile
@stephancom
stephancom / _poly_picker.html.slim
Last active August 21, 2019 14:48
polyPicker - allows for picking a polymorphic object in ActiveAdmin formtastic with select
/ _ ___ _ _
/ _ __ ___| |_ _| _ (_)__| |_____ _ _
/ | '_ \/ _ \ | || | _/ / _| / / -_) '_|
/ | .__/\___/_|\_, |_| |_\__|_\_\___|_|
/ |_| |__/ s.c14
/ This partial is meant to allow for picking an object of polymorphic type, returning both a type and id
/ It is comprised of two select elements, the first of which controls the available choices in the second
/ It relies on the poly_picker.js.coffee script on the front end
/ It expects to find these locals:
@dwwoelfel
dwwoelfel / gist:b859cee4b5f41af37ffd
Created August 1, 2014 21:05
Rough notes for setting up elastic beanstalk on CircleCI

In your repo's root directory, check in a requirements.txt with

boto==2.30.0

Then, from the project's Project Settings > Environment Variables page, add the two env vars: AWS_ACCESS_KEY_ID and AWS_SECRET_KEY, with an IAM key that can deploy to eb.

Then create a bash script to set up eb:

@hfreire
hfreire / qemu_osx_rpi_raspbian_jessie.sh
Last active February 4, 2025 00:47
How to emulate a Raspberry Pi (Raspbian Jessie) on Mac OSX (El Capitan)
# Install QEMU OSX port with ARM support
sudo port install qemu +target_arm
export QEMU=$(which qemu-system-arm)
# Dowload kernel and export location
curl -OL \
https://github.com/dhruvvyas90/qemu-rpi-kernel/blob/master/kernel-qemu-4.1.7-jessie
export RPI_KERNEL=./kernel-qemu-4.1.7-jessie
# Download filesystem and export location
@j-mcnally
j-mcnally / upgrade_container.sh
Last active June 15, 2018 10:51
Container Reload Script
#!/bin/bash
docker pull user/myrepo && \
docker rm -f myapp && \
docker run -d -p 80:80 -e RAILS_ENV=production --env-file=/opt/utils/deps/web.envfile --name=myapp --link=postgres:postgres --link=redis:redis user/myrepo

Principles of Adult Behavior

  1. Be patient. No matter what.
  2. Don’t badmouth: Assign responsibility, not blame. Say nothing of another you wouldn’t say to him.
  3. Never assume the motives of others are, to them, less noble than yours are to you.
  4. Expand your sense of the possible.
  5. Don’t trouble yourself with matters you truly cannot change.
  6. Expect no more of anyone than you can deliver yourself.
  7. Tolerate ambiguity.
  8. Laugh at yourself frequently.
# GIT heart FZF
# -------------
is_in_git_repo() {
git rev-parse HEAD > /dev/null 2>&1
}
fzf-down() {
fzf --height 50% --min-height 20 --border --bind ctrl-/:toggle-preview "$@"
}
@tatianamac
tatianamac / tatiana-mac-speaker-rider.md
Last active April 22, 2025 22:44
Tatiana Mac's Speaker Rider

Speaker Rider

by Tatiana Mac

Last updated 14 April 2021

What is a speaker rider?

As speaking comes with immense privilege, I have crafted a speaker rider to set expectations and boundaries around my engagement. I am grateful to all the conference organisers who have brilliantly hosted me. I would love to continue to exercise this privilege to speak at conferences, and use this privilege to make the landscape more accessible and beneficial to tech's most historically excluded and marginalised communities.

Considerations

😫 I provide a lot of explanations for those of you who never had to consider these things. Most thoughtful conferences I've attended check most of these boxes intrinsically, particularly when conference runners are experienced speakers. They get it.

@april
april / arena-macos-full-screen-fixes.sh
Last active July 16, 2025 17:52
Fixes Magic Arena's broken full screen implementation on macOS
#!/bin/bash
# this forces Arena into full screen mode on startup, set back to 3 to reset
# note that if you go into the Arena "Graphics" preference panel, it will reset all of these
# and you will need to run these commands again
defaults write com.wizards.mtga "Screenmanager Fullscreen mode" -integer 0
defaults write com.wizards.mtga "Screenmanager Resolution Use Native" -integer 0
# you can also replace the long complicated integer bit with any other scaled 16:9
# resolution your system supports.
@teryror
teryror / mulligans-and-mana-bases.md
Last active September 4, 2023 21:18
An updated and expanded guide on building mana bases in Magic: the Gathering

Mulligans and Mana Bases

For my previous post on how many colored sources you should put in your mana bases, I adapted Frank Karsten's simulation code to the London Mulligan rules change, and to make recommendations based on how many lands you want to play. In doing so, I made two errors: first, the tables for Commander decks do not take into account the free mulligan, or the turn one draw. Second, I changed the assumed mulligan strategy to be more aggressive; the effect of this change dominated over the effect of the London Mulligan, invalidating my comment on the matter.