Skip to content

Instantly share code, notes, and snippets.

View HenryTabima's full-sized avatar
🚀
Shipping code

Henry Tabima Giraldo HenryTabima

🚀
Shipping code
  • Colombia
View GitHub Profile
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@HenryTabima
HenryTabima / README-Template.md
Created August 20, 2019 01:49 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@HenryTabima
HenryTabima / custom_commands.rake
Created July 22, 2019 19:12
Final state of the custom_commands file
if Rails.env.development? || Rails.env.test?
require 'factory_bot'
namespace :dev do
desc 'This will add some development data '
task populate: 'db:migrate:reset' do
include FactoryBot::Syntax::Methods
3.times { create(:user_with_posts, post_count: 3) }
end
end
end
@HenryTabima
HenryTabima / factories.rb
Created July 22, 2019 19:07
Factories for the dev data population example
require 'faker'
FactoryBot.define do
factory :user, aliases: %i[author] do
email { Faker::Internet.email }
first_name { Faker::Name.first_name }
last_name { Faker::Name.last_name }
password { 'foobar' }
password_confirmation { 'foobar' }
@HenryTabima
HenryTabima / custom_commands.rake
Created July 22, 2019 18:13
Imagining that I have the models User and Post where users have many posts
# Imagine I have the models User and Post where users have many posts
if Rails.env.development? || Rails.env.test?
namespace :dev do
desc 'This will add some development data '
task populate: 'db:migrate:reset' do
3.times do |i|
user = User.create(…) #imagine the user content instead of "…"
user.posts.create(…) #imagine post content instead of "…"
end
end
@HenryTabima
HenryTabima / custom_commands.rake
Created July 22, 2019 16:46
Custom rake command for ruby on rails
if Rails.env.development? || Rails.env.test?
require 'factory_bot'
namespace :dev do
desc 'This will add some development data '
task populate: 'db:migrate:reset' do
include FactoryBot::Syntax::Methods
3.times { create(:user_with_posts, post_count: 3) }
end
end
end
@HenryTabima
HenryTabima / gh-pages-deploy.md
Created July 8, 2019 16:06 — forked from cobyism/gh-pages-deploy.md
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

@HenryTabima
HenryTabima / fancy-tabs-demo.html
Created June 28, 2019 04:02 — forked from ebidel/fancy-tabs-demo.html
Fancy tabs web component - shadow dom v1, custom elements v1, full a11y
<script>
function execPolyfill() {
(function(){
// CustomElementsV1.min.js v1 polyfill from https://github.com/webcomponents/webcomponentsjs/tree/v1/src/CustomElements/v1.
/*
Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
@HenryTabima
HenryTabima / flexbox-styles.css
Created March 28, 2019 14:17
First flex property
.container {
display: flex;
}