Skip to content

Instantly share code, notes, and snippets.

View andreimoment's full-sized avatar

Andrei Andreev andreimoment

View GitHub Profile
@andreimoment
andreimoment / Gemfile
Created July 3, 2014 21:37
rake db:migrate error
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.1.1'
# Use sqlite3 as the database for Active Record
# gem 'sqlite3'
gem 'pg'
# Use SCSS for stylesheets
@andreimoment
andreimoment / SassMeister-input-HTML.html
Last active August 29, 2015 14:04
Generated by SassMeister.com.
<div class="parent">
<div class="child">
<p>child 1</p>
<div class="grandchild">Grandchild 1</div>
<div class="grandchild last">Grandchild 2</div>
</div>
<div class="child last">child 2</div>
</div>
@andreimoment
andreimoment / SassMeister-input-HTML.html
Created August 12, 2014 00:53
Generated by SassMeister.com.
<div class="parent">
<div class="child one">Spaceflights cannot be stopped. This is not the work of any one man or even a group of men. It is a historical process which mankind is carrying out in accordance with the natural laws of human development.</div>
<div class="child two">The Earth was small, light blue, and so touchingly alone, our home that must be defended like a holy relic. The Earth was absolutely round. I believe I never knew what the word round meant until I saw Earth from space.</div>
<div
</div>
@andreimoment
andreimoment / Git
Created December 22, 2014 21:05
Git and Textmate Settings
[merge]
tool = p4merge
[mergetool "p4merge"]
path = C:\\Program Files\\Perforce\\p4merge.exe
[alias]
s = status
aa = add --all
ap = add --patch
ca = commit --amend
ci = commit -v

Custom Twitter Stylesheet

Craig Mod does a bigger overhaul with Twitter for Minimalists, but this will only do the following:

  • Hides promoted tweets and trends
  • Hides the useless “Expand” link that appears under every tweet
  • Tones down the blue conversation line to a barely-visible gray
  • Hides all numbers

You can add this CSS in Safari with this extension. The URL to target is twitter.com/*.

@andreimoment
andreimoment / application.rb
Created January 22, 2016 21:00
Ernie Miller's recommendation for application.rb
# config/application.rb
# published at https://ernie.io/2015/06/16/rails-application-rb-recommendations/
config.generators do |g|
g.assets = false # stop creating empty asset files for every controller you generate
g.helper = false # stop creating empty helper files
end
config.action_controller.include_all_helpers = false # only include this controller's helpers, do not include all others
config.active_record.schema_format = :sql # prevent loss of clarity caused by the lossy schema format
@andreimoment
andreimoment / sample.md
Created April 14, 2017 20:05
markdown sample

Mission Title Mission Subtitle

Here's the first paragraph introducing the mission.

  1. First step
  2. Second Step
  3. Third step

And some tips:

@andreimoment
andreimoment / customize_error.rb
Last active July 18, 2020 13:54 — forked from telwell/customize_error.rb
Customize Field Errors with Rails 5 and Bootstrap
ActionView::Base.field_error_proc = Proc.new do |html_tag, instance|
html = ''
form_fields = %w(textarea input select)
tag_elements = Nokogiri::HTML::DocumentFragment.parse(html_tag).css "label, " + form_fields.join(', ')
tag_elements.each do |e|
if e.node_name.eql? 'label'
html = %(#{e}).html_safe
elsif form_fields.include? e.node_name
@andreimoment
andreimoment / custom_helpers.rb
Last active February 21, 2018 21:04
Adds a vimeo_thumbnail helper to Middleman
# Adds a vimeo_thumbnail(vimeo_id, size) helper to Middleman
#
# by Andrei Andreev / github.com/andreimoment, 2018
#
# to install:
# - save the content of this gist to lib/custom_helpers.rb
# (you may need to create the lib folder and the custom_helpers.rb file)
#
# - add these two lines to config.rb:
# require 'lib/custom_helpers'
@andreimoment
andreimoment / offices.yml
Created July 5, 2018 22:09
HL Offices -- please confirm info
locales:
america:
placeholder: |
<h3>Houlihan Lokey is headquartered in Los Angeles with offices worldwide</h3>
cities:
- atlanta
- chicago
- dallas
- houston
- los_angeles