Skip to content

Instantly share code, notes, and snippets.

View fakefarm's full-sized avatar
🐽
🦁🍎🐸🧄🐔🍐🐹🍑🐮 🐴🦆🥦🐙🐳F🦞🧅🐶 🦧👾A🦈🐋🍉K🌽 🐣🐎🦚🦩🦔🐿🦨🐉🥕 🐿🐾🐒🍊E🐈🐻🥥🐱 🐼🥑🐷🐓🍌🐖F🦃 🐑🚜🍋🐂A🐏🌾🤖🐀🦔 R🦜🦝🐈🦓🐠🦑🦂M🐜

Dave Woodall fakefarm

🐽
🦁🍎🐸🧄🐔🍐🐹🍑🐮 🐴🦆🥦🐙🐳F🦞🧅🐶 🦧👾A🦈🐋🍉K🌽 🐣🐎🦚🦩🦔🐿🦨🐉🥕 🐿🐾🐒🍊E🐈🐻🥥🐱 🐼🥑🐷🐓🍌🐖F🦃 🐑🚜🍋🐂A🐏🌾🤖🐀🦔 R🦜🦝🐈🦓🐠🦑🦂M🐜
View GitHub Profile
@fakefarm
fakefarm / nginx.conf
Last active May 5, 2022 11:19 — forked from etagwerker/nginx-default
default configuration for nginx to work with a rails app
# This is example contains the bare mininum to get nginx going with
# Unicorn or Rainbows! servers. Generally these configuration settings
# are applicable to other HTTP application servers (and not just Ruby
# ones), so if you have one working well for proxying another app
# server, feel free to continue using it.
#
# The only setting we feel strongly about is the fail_timeout=0
# directive in the "upstream" block. max_fails=0 also has the same
# effect as fail_timeout=0 for current versions of nginx and may be
# used in its place.
@fakefarm
fakefarm / server.md
Created February 6, 2018 10:40 — forked from jtadeulopes/server.md
Server setup with ubuntu, nginx and puma for rails app.

Update and upgrade the system

sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade && sudo apt-get autoremove
sudo reboot

Configure timezone

@fakefarm
fakefarm / web-servers.md
Created January 17, 2018 02:03 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000

Effective Engineer - Notes

What's an Effective Engineer?

  • They are the people who get things done. Effective Engineers produce results.

Adopt the Right Mindsets

@fakefarm
fakefarm / secret_key_base
Created December 27, 2017 19:44 — forked from pablosalgadom/secret_key_base
app error: Missing `secret_key_base` for 'production' environment, set this value in `config/secrets.yml` (RuntimeError)
So i was using Rails 4.1 with Unicorn v4.8.2 and when i tried to deploy my app it doesn't start properly and into the unicorn.log file i found this error message:
"app error: Missing `secret_key_base` for 'production' environment, set this value in `config/secrets.yml` (RuntimeError)"
After a little research i found that Rails 4.1 change the way to manage the secret_key, so if we read the secrets.yml file located at exampleRailsProject/config/secrets.yml (you need to replace "exampleRailsProject" for your project name) you will find something like this:
# Do not keep production secrets in the repository,
# instead read values from the environment.
production:
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
@fakefarm
fakefarm / tag_pages.rb
Created December 4, 2017 20:55 — forked from floreal/tag_pages.rb
nanoc tag page gemerator + links to those
# Provides feature related to page tagging
#
module TagPages
# finds out every item containing tags
# @return Array an array of Nanoc::Item
def tagged_items
@items.select do |item|
item[:tags].is_a? Array
end
end
@fakefarm
fakefarm / config.rb
Created November 18, 2017 19:44 — forked from Arcovion/config.rb
Middleman extension to manage multiple directories
class Middleman::Extensions::DirManager < Middleman::Extension
register :dir_manager
option :dirs, {source: 'pages', destination: '', add: [], remove: ['', 'pages']}
def manipulate_resource_list resources
[options.dirs].flatten.each do |opts|
# Remove pages if specified
opts[:remove].each do |dir|
resources.reject! do |page|
Dir.glob(normalise(dir) + '/*', File::FNM_DOTMATCH).include? page.source_file
@fakefarm
fakefarm / mockDataSchema.js
Created September 21, 2017 23:55 — forked from coryhouse/mockDataSchema.js
Mock Data Schema for "Building a JavaScript Development Environment" on Pluralsight
export const schema = {
"type": "object",
"properties": {
"users": {
"type": "array",
"minItems": 3,
"maxItems": 5,
"items": {
"type": "object",
"properties": {
@fakefarm
fakefarm / .eslintrc.json
Created September 21, 2017 13:19 — forked from coryhouse/.eslintrc.json
.eslintrc.json file for "Building a JavaScript Development" Pluralsight course
{
"root": true,
"extends": [
"eslint:recommended",
"plugin:import/errors",
"plugin:import/warnings"
],
"parserOptions": {
"ecmaVersion": 7,
"sourceType": "module"