Skip to content

Instantly share code, notes, and snippets.

View BadAllOff's full-sized avatar
I'm open to new opportunities

BadAllOff BadAllOff

I'm open to new opportunities
View GitHub Profile
@alexbaumgertner
alexbaumgertner / js-courses.md
Last active July 18, 2024 08:31
JavaScript courses as on March 2016
@serghost
serghost / rails_admin.ru.yml
Created March 3, 2016 12:24
RU translation for the gem 'rails_admin' (перевод гема rails_admin)
# 02.03.2016 Перевод gem rails_admin ~> 0.8
# Не забудьте добавить переводы названия модели (в т.ч. мн. ч.) и - опционально - атрибутов.
# Некоторые переводы, где нужны склонения, видоизменены, тем не менее, имхо,
# это не повлияло на удобство интерфейса
ru:
admin:
js:
true: 'True'
false: 'False'
@BadAllOff
BadAllOff / application.html.erb
Last active August 16, 2018 17:55 — forked from suryart/application.html.erb
Rails 4 flash messages WITH GLYPHICONS using Twitter Bootstrap(bootstrap-sass: https://github.com/thomas-mcdonald/bootstrap-sass). An improved version of https://gist.github.com/roberto/3344628
// layout file
<body>
<div class="container">
<%= flash_messages %>
<%= yield %>
</div><!-- /container -->
</body>
@patik
patik / how-to-squash-commits-in-git.md
Last active May 30, 2024 07:59
How to squash commits in git

Squashing Git Commits

The easy and flexible way

This method avoids merge conflicts if you have periodically pulled master into your branch. It also gives you the opportunity to squash into more than 1 commit, or to re-arrange your code into completely different commits (e.g. if you ended up working on three different features but the commits were not consecutive).

Note: You cannot use this method if you intend to open a pull request to merge your feature branch. This method requires committing directly to master.

Switch to the master branch and make sure you are up to date:

@eliotsykes
eliotsykes / rails_new_help_output.md
Last active March 29, 2025 08:11
"rails new" options explained

Run rails new --help to view all of the options you can pass to rails new:

$ bin/rails new --help
Usage:
  rails new APP_PATH [options]

Options:
  -r, [--ruby=PATH]                                      # Path to the Ruby binary of your choice
                                                         # Default: /Users/eliot/.rbenv/versions/2.2.0/bin/ruby
@brianpetro
brianpetro / rails-4-new-options
Created April 28, 2015 18:11
Command line options for ` rails new --help ` (Rails 4.2). Useful for planning new Ruby on Rails app. 'Where can I find options for “rails new” command?'
Because I couldn't find these with a quick Google search on 28 April 2015:
Usage:
rails new APP_PATH [options]
Options:
-r, [--ruby=PATH] # Path to the Ruby binary of your choice
# Default: /home/brian/.rvm/rubies/ruby-2.2.0/bin/ruby
-m, [--template=TEMPLATE] # Path to some application template (can be a filesystem path or URL)
[--skip-gemfile], [--no-skip-gemfile] # Don't create a Gemfile
@palkan
palkan / rubocop_pre_commit_hook
Last active June 19, 2024 10:41 — forked from mpeteuil/rubocop_pre_commit_hook
Rubocop pre-commit hook
#!/usr/bin/env ruby
ADDED_OR_MODIFIED = /^\s*(A|AM|M)/.freeze
changed_files = `git status --porcelain`.split(/\n/)
unstaged_files = `git ls-files -m`.split(/\n/)
changed_files = changed_files.select { |f| f =~ ADDED_OR_MODIFIED }
changed_files = changed_files.map { |f| f.split(" ")[1] }
@DavidWells
DavidWells / reset.css
Last active April 12, 2025 01:50 — forked from karbassi/reset.css
CSS reset. Follow me on the twitters for more tips: https://twitter.com/davidwells
/* http://meyerweb.com/eric/tools/css/reset/
v2.0-modified | 20110126
License: none (public domain)
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
@emaraschio
emaraschio / SOLID.markdown
Last active February 16, 2025 23:43
SOLID Principles with ruby examples

SOLID Principles with ruby examples

SRP - Single responsibility principle

A class should have only a single responsibility.

Every class should have a single responsibility, and that responsibility should be entirely encapsulated. All its services should be narrowly aligned with that responsibility, this embrace the high cohesion.

OCP - Open/closed principle

Software entities should be open for extension, but closed for modification.

@maxivak
maxivak / 00.md
Last active December 10, 2023 14:50
Using RSpec without Rails

Using RSpec without Rails