Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
setting my status ...

Joe Kratzat joekr

💭
setting my status ...
View GitHub Profile
@joekr
joekr / Dockerfile-Nginx
Last active Apr 14, 2021
Kubernetes + Rails (NGINX & Unicorn) on GCE
View Dockerfile-Nginx
# Set nginx base image
FROM nginx
# Copy custom configuration file from the current directory
COPY nginx.conf /etc/nginx/nginx.conf
View keybase.md

Keybase proof

I hereby claim:

  • I am joekr on github.
  • I am joekratzat (https://keybase.io/joekratzat) on keybase.
  • I have a public key whose fingerprint is 5A15 7CE4 86C8 9D90 9B64 452D F31D 8021 A7ED 1C26

To claim this, I am signing this object:

View Vagrant
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = '2'
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = 'hashicorp/precise64'
# Configurate the virtual machine to use 2GB of RAM
@joekr
joekr / Message.rb
Last active Aug 29, 2015
Crazy polymorphic multiple has_many association
View Message.rb
class Message < ActiveRecord::Base
belongs_to :recipient, :polymorphic => true
belongs_to :sender, :polymorphic => true
end
View watch_dog.go
package main
import "fmt"
import "net/http"
import "time"
import "os"
func main() {
if len(os.Args) < 2 {
fmt.Println("Need a url", len(os.Args))
@joekr
joekr / build.gradle
Created Oct 24, 2013
default build.gradle for libraries.
View build.gradle
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.5+'
}
}
apply plugin: 'android-library'
@joekr
joekr / user.rb
Last active Dec 25, 2015
Rspec a public method which calls a private method.
View user.rb
class User < ActiveRecord::Base
def my_public_method
self.my_private_method
end
private
def my_private_method
true
@joekr
joekr / unicorn.conf
Last active Dec 25, 2015
nginx sites-enabled file for generic rails project using unicorn
View unicorn.conf
upstream unicorn_server {
# This is the socket we configured in unicorn.rb
server unix:/srv/www/example/shared/sockets/unicorn.sock fail_timeout=0;
}
server{
listen 80 default;
server_name example;
root /srv/www/example/current/public;
try_files $uri/index.html $uri.html $uri @unicorn;
View unicorn.conf
/path/to/unicorn/log/unicorn.stderr.log
/path/to/production/log/production.log
{
daily
missingok
rotate 14
compress
dateext
# this is important if using "compress" since we need to call
View .gitignore
#########################
# .gitignore file for Xcode4 / OS X Source projects
#
# Version 2.0
# For latest version, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects
#
# 2013 updates:
# - fixed the broken "save personal Schemes"
#
# NB: if you are storing "built" products, this WILL NOT WORK,