Skip to content

Instantly share code, notes, and snippets.

View andreimoment's full-sized avatar

Andrei Andreev andreimoment

View GitHub Profile
@andreimoment
andreimoment / dabblet.css
Created January 27, 2012 06:35 — forked from chriscoyier/dabblet.css
Animate to natural width
/* Animate to natural width */
body { background: black; padding: 100px; margin: 0; }
.progress-bar {
border: 2px solid red;
border-radius: 14px;
}
.progress-bar > div {
@andreimoment
andreimoment / syntax_highlighting.py
Created March 21, 2012 00:29 — forked from JeanMertz/syntax_highlighting.py
Ruby on Rails syntax highlight switcher for Sublime Text 2
import sublime, sublime_plugin
import os
class DetectFileTypeCommand(sublime_plugin.EventListener):
""" Detects current file type if the file's extension isn't conclusive """
""" Modified for Ruby on Rails and Sublime Text 2 """
""" Original pastie here: http://pastie.org/private/kz8gtts0cjcvkec0d4quqa """
def on_load(self, view):
filename = view.file_name()
@andreimoment
andreimoment / gist:2143516
Created March 21, 2012 01:41 — forked from JeanMertz/gist:1885444
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (PC)

Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.

Editing

Ctrl+X delete line
Ctrl+↩ insert line after
Ctrl+⇧+↩ insert line before
Ctrl+⇧+↑ move line (or selection) up
@andreimoment
andreimoment / webdev-tools.md
Created October 15, 2012 17:03 — forked from poteto/webdev-tools.md
Web tools directory
@andreimoment
andreimoment / classes.sass
Created November 5, 2012 23:23 — forked from OutThisLife/classes.sass
classes.sass
/**
* Sass mixins
*/
@charset "UTF-8"
// Force output of above line by adding a unicode character. ♫
// -----------------------------------------------
@mixin textFillColor($type)
class RomanNumeral
def self.add_roman(roman_number)
result = 0
roman_number.each_char do |c|
result += roman_lookup(c)
end
@andreimoment
andreimoment / .gitconfig
Last active December 26, 2015 04:39 — forked from orj/.gitconfig
gitconfig settings for p4merge
[merge]
keepBackup = false
tool = custom
[mergetool "custom"]
cmd = /Applications/p4merge.app/Contents/Resources/launchp4merge "$BASE" "$REMOTE" "$LOCAL" "$MERGED"
keepTemporaries = false
trustExitCode = false
keepBackup = false
<textarea name="my-xml-editor" data-editor="xml" rows="15"></textarea>
...
<textarea name="my-markdown-editor" data-editor="markdown" rows="15"></textarea>
...
<script src="//d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js"></script>
<script>
// Hook up ACE editor to all textareas with data-editor attribute
$(function () {

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 / 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