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 / 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 / how-to-create-a-vue-plugin.md
Last active March 10, 2022 16:36
Vue Js - How to create a component as a Vue Plugin - Step by step

How to create a Vue Plugin Component

Notes from reading cristijora/vue-paper-dashboard SidebarPlugin

Usually components are suited for most cases. I would say 80-90% of the cases. For the rest 10-20%, you might find yourself using directives and plugins. Plugins usually incorporate some logic (data, component registration, maybe mixins or even directives)

  • cristijora

Step 1. create a directory for the plugin

@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"
@fakefarm
fakefarm / package.json
Created September 20, 2017 20:38 — forked from coryhouse/package.json
package.json for Building a JS Development Environment on Pluralsight
{
"name": "javascript-development-environment",
"version": "1.0.0",
"description": "JavaScript development environment Pluralsight course by Cory House",
"scripts": {
},
"author": "Cory House",
"license": "MIT",
"dependencies": {
"whatwg-fetch": "1.0.0"
@fakefarm
fakefarm / regenerate-binstubs.sh
Created September 20, 2017 17:36 — forked from demisx/regenerate-binstubs.sh
Regenerate and Springify Rails 4 binstubs
cd my_rails_app_root_dir
rm bin/*
bundle exec rake rails:update:bin
bundle binstubs rspec-core
spring binstub --all
@fakefarm
fakefarm / easy_as_pry.md
Last active July 12, 2017 16:57
Easy as Pry

Problem

I'm starting work on a API call which I have no idea what the data structure is or where the data I'm interested in comes into play. I work through a VM so I don't currently have access to PRY. I looked to see what kind of logging we have in place but I didn't find anything that was as easy as pry for a direct look at my issue. I also didn't want to parse through all the noise of development.log by simply using logger.info

Solution

This is what I came up with

 class Log