View gist:9529095
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class User | |
has_many friendships | |
has_many friends, :through => :friendships, source: :friend | |
end | |
class Friendship | |
belongs_to :user | |
belongs_to :friend, class_name: "User" | |
end |
View bin_numbers.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{"binNumber": "400684", "bankName": "ING Bank A.Ş.", "cardBrand": "Bonus", "bankCode": "099"}, | |
{"binNumber": "401622", "bankName": "YAPI ve KREDİ BANKASI A.Ş.", "cardBrand": "World", "bankCode": "067"}, | |
{"binNumber": "401738", "bankName": "GARANTİ BANKASI A.Ş.", "cardBrand": "Bonus", "bankCode": "062"}, | |
{"binNumber": "402275", "bankName": "ASYA KATILIM BANKASI A.Ş.", "cardBrand": "Asya", "bankCode": "208"}, | |
{"binNumber": "402276", "bankName": "ASYA KATILIM BANKASI A.Ş.", "cardBrand": "Asya", "bankCode": "208"}, | |
{"binNumber": "402277", "bankName": "FİNANSBANK A.Ş.", "cardBrand": "CardFinans", "bankCode": "111"}, | |
{"binNumber": "402278", "bankName": "FİNANSBANK A.Ş.", "cardBrand": "CardFinans", "bankCode": "111"}, | |
{"binNumber": "402280", "bankName": "ASYA KATILIM BANKASI A.Ş.", "cardBrand": "Asya", "bankCode": "208"}, | |
{"binNumber": "402458", "bankName": "TÜRK EKONOMİ BANKASI TEB A.Ş.", "cardBrand": "Bonus", "bankCode": "032"}, |
View Gemfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem 'google-api-client' |
View gradient_descent.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def params | |
[0,0] | |
end | |
def examples | |
[ | |
{ | |
:x => 1, | |
:y => 3 | |
}, |
View line.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'generator' | |
samples = [ | |
{ :xs => [ 1.0, 0.25], :y => 0.98}, | |
{ :xs => [ 1.0, 0.49], :y => 0.82}, | |
{ :xs => [ 1.0, 0.60], :y => 0.41}, | |
{ :xs => [ 1.0, 0.89], :y => 0.31} | |
] | |
# line is the sum of the dot product of the weight (thetas) |
View turkce_isimler.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Turkce isimler sozlugu twitter : http://twitter.com/tserpico | |
CREATE TABLE `isimler` ( | |
`id` int(11) NOT NULL AUTO_INCREMENT, | |
`isimler` varchar(255) DEFAULT NULL, | |
`cinsiyet` varchar(255) DEFAULT NULL COMMENT 'erkek : E , kadın : K , uniseks : U', | |
PRIMARY KEY (`id`) | |
) ENGINE=InnoDB; | |
-- ---------------------------- |
View reload css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function reloadStylesheets () { | |
var queryString = '?reload=' + new Date().getTime(); | |
jQuery('link[rel="stylesheet"]').each(function () { | |
this.href = this.href.replace(/\?.*|$/, queryString); | |
}); | |
} |
View feelbetter.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Twit = require("twit"); | |
var config = require('./oauthconfig'); | |
console.log("config:"); | |
console.log(config); | |
var T = new Twit({ | |
consumer_key: config.consumer_key, | |
consumer_secret: config.consumer_secret, | |
access_token: config.access_token, |
View unicorn.rake
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Tasks for managing Unicorn instances of a Rails application. | |
# Compatible with Ruby >= 1.9.2 and Rails >= 2 . | |
# Unicorn signals: http://unicorn.bogomips.org/SIGNALS.html | |
namespace :unicorn do | |
class UnicornPIDError < StandardError; end | |
def rails_env | |
Rails.env |
OlderNewer