Skip to content

Instantly share code, notes, and snippets.

View danschultzer's full-sized avatar
💭
I may be slow to respond.

Dan Schultzer danschultzer

💭
I may be slow to respond.
View GitHub Profile
@lizthegrey
lizthegrey / attributes.rb
Last active September 24, 2024 14:33
Hardening SSH with 2fa
default['sshd']['sshd_config']['AuthenticationMethods'] = 'publickey,keyboard-interactive:pam'
default['sshd']['sshd_config']['ChallengeResponseAuthentication'] = 'yes'
default['sshd']['sshd_config']['PasswordAuthentication'] = 'no'
@csferrie
csferrie / real_bday_paradox.ipynb
Last active April 10, 2023 16:02
The real birthday paradox. Code for the following blog post on csferrie.com: https://csferrie.com/2017/03/23/the-power-of-simulation-birthday-paradox/
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rsgrafx
rsgrafx / paperclip.ex
Last active September 18, 2017 15:28
Setting up Arc in a phoenix app that was ported from a rails app using paperclip.
# Ecto - Model
defmodule YourPhoenixApp.PaperclipAvatar do
use YourPhoenixApp.Web, :model
alias YourPhoenixApp.{Repo, PaperclipAvatar}
#
# There are places in my existing app where only the avatar image is required.
# So I created a module that sole purpose was to read that data.
#
schema "users" do
field :avatar_file_name, :string
@kyledrake
kyledrake / ferengi-plan.txt
Last active October 3, 2024 15:12
How to throttle the FCC to dial up modem speeds on your website using Nginx
# The blog post that started it all: https://neocities.org/blog/the-fcc-is-now-rate-limited
#
# Current known FCC address ranges:
# https://news.ycombinator.com/item?id=7716915
#
# Confirm/locate FCC IP ranges with this: http://whois.arin.net/rest/net/NET-165-135-0-0-1/pft
#
# In your nginx.conf:
location / {
@netzpirat
netzpirat / 0_README.md
Created November 12, 2010 10:42
Continuous CoffeeScript testing with Guard and Jasmine

Continuous CoffeeScript testing with Guard and Jasmine

This Gist shows how to set up a Rails project to practice BDD with CoffeeScript, Guard and Jasmine. You can see this setup in action on Vimeo

  • Install Gems with Bundler with bundle install
  • Define your guards with mate Guardfile
  • Initialize Jasmine with bundle exec jasmine init
  • Configure Jasmine with mate spec/support/yasmine.ym
  • Start Guard with bundle exec guard