Skip to content

Instantly share code, notes, and snippets.

Avatar
📢
tweet tweet.

Dave Woodall at your service. fakefarm

📢
tweet tweet.
View GitHub Profile
View borgs.c
/*
Mmachine learnng crawling Robot using Simple Reinforcement Learning
by: jim demello
*/
// Servo setup: the servos must be oriented so that if the arm is rotating counter-clockwise to the left of the servo, then up is 0 degrees
// and down is 180 degrees, for both servos. Then when the arm is in it's highest postion, servo 1 (the servo closest to the
// body of the robot, will be at 0 degrees and servo 2 will be at 40 degrees.)
// Sonar: the ultrasonic module should be placed facing the rear of the robot as it measures movement of the robot away from some
// solid structure like a wall.
View sock.rb
class SockMerchant
attr_reader :pile
def initialize(socks: , pile:)
@socks = socks
@pile = pile
end
def match
last = nil;
@fakefarm
fakefarm / server.md
Created Feb 6, 2018 — forked from jtadeulopes/server.md
Server setup with ubuntu, nginx and puma for rails app.
View server.md

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 Jan 17, 2018 — forked from willurd/web-servers.md
Big list of http static server one-liners
View web-servers.md

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
View Effective_Engineer.md

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 Dec 27, 2017 — forked from pablosalgadom/secret_key_base
app error: Missing `secret_key_base` for 'production' environment, set this value in `config/secrets.yml` (RuntimeError)
View secret_key_base
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 Dec 4, 2017 — forked from floreal/tag_pages.rb
nanoc tag page gemerator + links to those
View tag_pages.rb
# 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 Nov 18, 2017 — forked from Arcovion/config.rb
Middleman extension to manage multiple directories
View config.rb
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 Jan 17, 2020
Vue Js - How to create a component as a Vue Plugin - Step by step
View how-to-create-a-vue-plugin.md

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