Skip to content

Instantly share code, notes, and snippets.

@tekin
tekin / some_auth_controller.rb
Created September 3, 2011 15:12
example code for doing OAuth with Twitter using the oauth gem.
def SomeAuthController < ApplicationController
def twitter_auth
request_token = twitter_consumer.get_request_token(:oauth_callback => twitter_callback_credentials_url)
session['twitter_request_token'] = request_token.token
session['twitter_request_secret'] = request_token.secret
redirect_to request_token.authorize_url
end
def twitter_callback
@tekin
tekin / gist:2643351
Created May 9, 2012 09:39
Coding stats
tekin@anikulapo:~/projects/crowd.fm$ rake stats
+----------------------+-------+-------+---------+---------+-----+-------+
| Name | Lines | LOC | Classes | Methods | M/C | LOC/M |
+----------------------+-------+-------+---------+---------+-----+-------+
| Controllers | 922 | 777 | 30 | 123 | 4 | 4 |
| Helpers | 190 | 159 | 0 | 23 | 0 | 4 |
| Models | 1266 | 978 | 26 | 151 | 5 | 4 |
| Libraries | 2691 | 2051 | 23 | 250 | 10 | 6 |
| Integration tests | 1112 | 883 | 26 | 3 | 0 | 292 |
| Functional tests | 2219 | 1957 | 28 | 18 | 0 | 106 |

Keybase proof

I hereby claim:

  • I am tekin on github.
  • I am tekin (https://keybase.io/tekin) on keybase.
  • I have a public key whose fingerprint is FB9F BD4D 775C E14B F481 1BB1 4AB5 9526 95A5 5C7E

To claim this, I am signing this object:

@tekin
tekin / .gitattributes
Last active June 7, 2026 11:05
An example .gitattributes file that will configure custom hunk header patterns for some common languages and file formats. See https://tekin.co.uk/2020/10/better-git-diff-output-for-ruby-python-elixir-and-more for more details.
# Stick this in your home directory and point your Global Git config at it by running:
#
# $ git config --global core.attributesfile ~/.gitattributes
#
# See https://tekin.co.uk/2020/10/better-git-diff-output-for-ruby-python-elixir-and-more for more details
*.c diff=cpp
*.h diff=cpp
*.c++ diff=cpp
*.h++ diff=cpp