Skip to content

Instantly share code, notes, and snippets.

View toadkicker's full-sized avatar
🏠
Let's fix some stuff

Todd Baur toadkicker

🏠
Let's fix some stuff
View GitHub Profile
@innesm4
innesm4 / gist:42d2e1f7fc89b6dfaf43
Created September 4, 2014 10:18
Super Fast Apache.conf
#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 30
#
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to "Off" to deactivate.
#
KeepAlive On
@vdm
vdm / ixgbevf-upgrade.sh
Last active November 28, 2019 21:35
ixgbevf 2.16.1 upgrade for AWS EC2 SR-IOV "Enhanced Networking" on Ubuntu 14.04 (Trusty) LTS
ssh [email protected] "bash -s -x" -- <ixgbevf-upgrade.sh
@wendygwo
wendygwo / Adding 'Forgot Password' to login page.md
Last active August 8, 2024 19:08
How to add 'Forgot password' to a Rails app that's using bcrypt for authentication

Credit:

All the steps below came from watching the Railscast below:

http://railscasts.com/episodes/274-remember-me-reset-password

The steps below assumes that your app already has a user and user authentication set up.

  • Add to app/views/sessions/new.html.erb file
<p><%= link_to 'Forgot password?', new_password_reset_path %></p>
@kwmiebach
kwmiebach / webstorm-cheat-sheet.md
Last active April 11, 2024 11:18
Webstorm cheat sheet
@jeremypruitt
jeremypruitt / sns-publish
Last active August 19, 2022 18:09
AWS Lambda function to publish to SNS topic
console.log('Loading function');
var AWS = require('aws-sdk');
AWS.config.region = 'us-west-2';
exports.handler = function(event, context) {
console.log("\n\nLoading handler\n\n");
var sns = new AWS.SNS();
sns.publish({
@edwardsamuel
edwardsamuel / vpc-scenario-2.json
Created July 4, 2015 14:40
AWS CloudFormation Template: VPC
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "A VPC environment in two availability zones with an NAT instance.",
"Parameters": {
"envPrefix": {
"Description": "Environment name prefix.",
"Type": "String",
"Default": "Test"
},
"vpcCidr": {
@ourmaninamsterdam
ourmaninamsterdam / LICENSE
Last active February 9, 2025 08:41
Arrayzing - The JavaScript array cheatsheet
The MIT License (MIT)
Copyright (c) 2015 Justin Perry
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
@xecutioner
xecutioner / rspec_model_testing_template.rb
Last active May 29, 2017 07:19 — forked from PWSdelta/rspec_model_testing_template.rb
Rails Rspec model testing skeleton & cheat sheet using rspec-rails, shoulda-matchers, shoulda-callbacks, and factory_girl_rails. Pretty much a brain dump of examples of what you can (should?) test in a model. Pick & choose what you like, and please let me know if there are any errors or new/changed features out there. Reddit comment thread: http…
# This is a skeleton for testing models including examples of validations, callbacks,
# scopes, instance & class methods, associations, and more.
# Pick and choose what you want, as all models don't NEED to be tested at this depth.
#
# I'm always eager to hear new tips & suggestions as I'm still new to testing,
# so if you have any, please share!
#
# @kyletcarlson
#
# This skeleton also assumes you're using the following gems:
@cdornsife
cdornsife / archive_email.sh
Last active December 24, 2024 16:13
If you wish to archive all emails in postfix using always_bcc, you can use this script to tame your archive email account. This script relies on doveadm to manage the files. Add it to your daily cron.
#! /bin/bash
# change your /etc/postfix/main.cf
# always_bcc = [email protected]
DOMAIN=example.com
ARCHIVE=archive@$DOMAIN
getemail() {
doveadm fetch -u $ARCHIVE hdr mailbox-guid $1 uid $2 | grep "$3" | cut -f 2 -d "<" | cut -f 1 -d ">"
}
#!/usr/bin/env bash
# requires: pip install awscli awsebcli
# PARAMETERS
env="dev"
fail() {
echo configuration failed
exit 1