Skip to content

Instantly share code, notes, and snippets.

View canvural's full-sized avatar

Can Vural canvural

View GitHub Profile
@ericlbarnes
ericlbarnes / filters.php
Created July 16, 2013 17:30 — forked from anonymous/filters.php
Laravel CSRF Ajax
/**
* Filter to check for CSRF attacks from the ajax requests.
*/
Route::filter('csrf_header', function()
{
if (Session::token() != Request::header('x-csrf-token'))
{
throw new Illuminate\Session\TokenMismatchException;
}
});
#!/usr/local/bin/ruby
# A script to download the latest episodes from railscasts.com
#
# author: modsaid <mahmoud@modsaid.com>
# mechanize support: Hossam Hammady <github@hammady.net>
# gem install mechanize
require 'rubygems'
require 'mechanize'
@vigo
vigo / ruby-tips.md
Created November 4, 2012 22:50
Ruby Tips

Ruby Tips

Genel

  • Herşey bir Object (Nesne)
  • Her Object BasicObjectden türemiş. (Objective-C NSObject gibi...)
  • Object.methods ile o nesneye ait tüm method'lar
  • Object.methods.inspect string olarak method'lar
  • Mutlaka bir şey geriye döner. Hiçbir şey dönmese nil döner.

Style Guide

@jeffkreeftmeijer
jeffkreeftmeijer / bassie.png
Created April 11, 2011 12:01
Colored image blob detection
bassie.png