Skip to content

Instantly share code, notes, and snippets.

View mariozugaj's full-sized avatar

Mario Zugaj mariozugaj

View GitHub Profile
@PurpleBooth
PurpleBooth / README-Template.md
Last active April 26, 2024 17:22
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

@mrmartineau
mrmartineau / stimulus.md
Last active April 19, 2024 09:41
Stimulus cheatsheet
# config/routes.rb
resources :documents do
scope module: 'documents' do
resources :versions do
post :restore, on: :member
end
resource :lock
end
end
@robzolkos
robzolkos / Dockerfile
Last active March 2, 2024 20:59
Kamal / SQLite3 issue
# syntax = docker/dockerfile:1
# Make sure RUBY_VERSION matches the Ruby version in .ruby-version and Gemfile
ARG RUBY_VERSION=3.2.2
FROM registry.docker.com/library/ruby:$RUBY_VERSION-slim as base
# Rails app lives here
WORKDIR /rails
# Set production environment
@broofa
broofa / pre-commit
Last active February 23, 2024 08:55
Git pre-commit hook that runs `eslint` with the `--fix` option to fix up issues where possible, and adds "fix"ed files into the commit
#!/bin/bash
cd "$(git rev-parse --show-toplevel)"
ESLINT="node_modules/.bin/eslint"
pwd
if [[ ! -x "$ESLINT" ]]; then
printf "\t\033[41mPlease install ESlint\033[0m (npm install eslint)\n"
exit 1
fi
@zhengjia
zhengjia / capybara cheat sheet
Created June 7, 2010 01:35
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
@ryansobol
ryansobol / gist:5252653
Last active November 22, 2023 11:53
15 Questions to Ask During a Ruby Interview

Originally published in June 2008

When hiring Ruby on Rails programmers, knowing the right questions to ask during an interview was a real challenge for me at first. In 30 minutes or less, it's difficult to get a solid read on a candidate's skill set without looking at code they've previously written. And in the corporate/enterprise world, I often don't have access to their previous work.

To ensure we hired competent ruby developers at my last job, I created a list of 15 ruby questions -- a ruby measuring stick if you will -- to select the cream of the crop that walked through our doors.

What to expect

Candidates will typically give you a range of responses based on their experience and personality. So it's up to you to decide the correctness of their answer.

@sheharyarn
sheharyarn / request.js
Last active August 24, 2023 14:55
Axios Request Wrapper for React (https://to.shyr.io/axios-requests)
/**
* Axios Request Wrapper
* ---------------------
*
* @author Sheharyar Naseer (@sheharyarn)
* @license MIT
*
*/
import axios from 'axios'
@dbridges
dbridges / _comment.html.slim
Last active August 25, 2022 18:51
Stimulus.js and Rails remote forms with error handling
- # app/views/comments/_comment.html.slim
li data-controller="comment" data-action="click->comment#hello"
= "#{comment.message} by #{comment.user.email}"
@Nakilon
Nakilon / checklist.md
Last active May 28, 2021 12:49
new macOS configuration checklist
  • настроить все в System Preferences, например

    • выключить Correct spelling automatically
    • инвертировать кнопку Fn
    • поставить раскладки "США" (на новых макбуках тильды будет слева внизу) и "Русская - ПК"
  • выключить ускорение указателя трекпада и перелогиниться

    defaults write .GlobalPreferences com.apple.trackpad.scaling -1
  • настроить Finder (войти в настройки любой программы в Mac OS можно комбинацией ⌘,)