Skip to content

Instantly share code, notes, and snippets.

@vlazar
vlazar / iterm2-command-click-to-open-in-rubymine.md
Created February 24, 2018 13:21
Command-Click on filename in iTerm2 to open it in RubyMine

Command-Click on filename in iTerm2 to open it in RubyMine

For regular file names

app/models/post.rb
spec/models/post.rb:42
  1. Open iTerm2 Preferences -> Profiles -> Default -> Advanced
@vlazar
vlazar / gist:6099686
Created July 28, 2013 19:00
Making requests with OAuth, refreshing access tokens.
# OAuth 1, OAuth 2
# 1. Make requests
# 2. Refresh access tokens
# ------------------------------------------------------------------------
# OAuth 1
# options from OmniAuth::Strategies::Yahoo.default_options[:client_options]
consumer_options = {
:access_token_path => '/oauth/v2/get_token',
:authorize_path => '/oauth/v2/request_auth',
@vlazar
vlazar / gist:4249741
Created December 10, 2012 10:10
Async snippet
// http://www.stevesouders.com/blog/2010/05/11/appendchild-vs-insertbefore/
(function(doc, script) {
var firstScript = doc.getElementsByTagName(script)[0],
newScript = doc.createElement(script);
newScript.type = 'text/javascript';
newScript.async = true;
newScript.src = ('https:' == doc.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
firstScript.parentNode.insertBefore(newScript, firstScript);
@vlazar
vlazar / CDN_JS_fallback.html
Created April 21, 2012 03:07
Fallback for JS in CDN
<!-- Use fallback for CDN hosted asset -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/libs/jquery-1.7.2.min.js"><\/script>')</script>
@vlazar
vlazar / gist:2017406
Created March 11, 2012 17:52
Replacing the -9999px CSS hack (new image replacement)
.hide-text { text-indent: -9999px; } /* stop using this, poor performance! */
/* better way to do it: */
.hide-text { text-indent: 100%; white-space: nowrap; overflow: hidden; }
@vlazar
vlazar / gist:1991584
Created March 7, 2012 07:10
Chrome URLs
List of Chrome URLs
chrome://chrome-urls/