Skip to content

Instantly share code, notes, and snippets.

@D-system
D-system / autogrow.ng.js
Last active May 17, 2017 06:50 — forked from thomseddon/gist:4703968
Angularjs: fit textarea size to text
/*
* Adapted from: http://code.google.com/p/gaequery/source/browse/trunk/src/static/scripts/jquery.autogrow-textarea.js
* Updated from: https://gist.github.com/thomseddon/4703968
*
* Works nicely with the following styles:
* textarea {
* resize: none;
* transition: 0.05s;
* -moz-transition: 0.05s;
* -webkit-transition: 0.05s;
@D-system
D-system / pretty_git_log.sh
Created June 20, 2013 09:25
Pretty git log
alias glog="git log --format='%Cgreen%h%Creset %C(cyan)%an%Creset - %s' --graph"
@D-system
D-system / ls_tree_view.sh
Created June 20, 2013 09:26
ls tree view
alias tree="ls -R | grep ':$' | sed -e 's/:$//' -e 's/[^\/]*\//| /g' -e 's/| \([^|]\)/\`--\1/g'"
@D-system
D-system / zshrc
Created June 20, 2013 09:28
zshrc
autoload -Uz promptinit
promptinit
prompt adam1
setopt histignorealldups sharehistory
# Use emacs keybindings even if our EDITOR is set to vi
bindkey -e
@D-system
D-system / emacs_no_tild.lisp
Created June 20, 2013 09:30
Disable tilde (tmp) file for emacs
(setq make-backup-files nil)
body {
background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAIElEQVQYV2M0MLX7z0AEYAQp/PPnL0GlowrxBhHRwQMA6Ucq/Mkjk9gAAAAASUVORK5CYII=) repeat;
}
@D-system
D-system / rails_resources.md
Last active January 30, 2019 12:53 — forked from jookyboi/rails_resources.md
Rails-related Gems and guides to accelerate your web project.

Gems

  • Bundler - Bundler maintains a consistent environment for ruby applications. It tracks an application's code and the rubygems it needs to run, so that an application will always have the exact gems (and versions) that it needs to run.
  • rabl - General ruby templating with json, bson, xml, plist and msgpack support
  • jbuilder - JSON builder shipped with Rails.
  • builder XML builder shipped with Rails.
  • Puma - A Ruby/Rack web server built for concurrency. Shipped with Rails.
  • SimpleCov - SimpleCov is a code coverage analysis tool for Ruby 1.9.
  • bootstrap - Bootsnap preloads your Rails app so that your normal development tasks such as console, server, generate, and specs/tests is faster.
  • factory_bot - factory_
<div class="inner">
<br /><br /><br />
<input type="email" required="" />
<label placeholder="Token"></label>
</div>
@D-system
D-system / application_controller.rb
Created March 19, 2015 08:16
Expires any page in any situation (including the back button action)
def expires_now
# override default method due to some browsers cases (http://stackoverflow.com/a/18516720/856151)
response.headers['Cache-Control'] = 'no-cache, no-store, must-revalidate' # HTTP 1.1.
response.headers['Pragma'] = 'no-cache' # HTTP 1.0.
response.headers['Expires'] = '0' # Proxies.
end
=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')