Skip to content

Instantly share code, notes, and snippets.

View seyyah's full-sized avatar

seyyah seyyah

View GitHub Profile
td= truncate(period.program.name, length: 30)
td= truncate(period.name, length: 47)
td= period.code
td
- if can? :read, Student
= link_to "Öğrenciler", students_admin_period_path(period)
span |
= link_to (t "general.show"), [:admin, period]
- if can? :update, Period
span |
@seyyah
seyyah / attachment.rb
Last active October 14, 2015 07:23 — forked from madwork/attachment.rb
class Attachment < ActiveRecord::Base
mount_uploader :attachment, AttachmentUploader
# Associations
belongs_to :attached_item, polymorphic: true
# Validations
validates_presence_of :attachment
@seyyah
seyyah / my.cnf
Last active August 29, 2015 14:09 — forked from roktas/my.cnf
[mysqld]
# ----------------------------------------------------------------------
# UTF-8 temiz bir mysql için ilgili yapılandırma
# ----------------------------------------------------------------------
init_connect=’SET collation_connection = utf8_general_ci’
init_connect=’SET NAMES utf8′
character-set-server=utf8
collation-server=utf8_general_ci
@seyyah
seyyah / 0_reuse_code.js
Last active August 29, 2015 14:07
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
# coding: utf-8
require 'savon'
require 'awesome_print'
class KPSSorgu
# T.C. Kimlik ile Kişi Sorgulama - Konfigürasyon
@@tc_bilgi_client = Savon.client(
wsdl: "http://192.168.33.25/KPSService/servicetckimliksorgula.asmx?WSDL",
namespace: "http://tempuriTCKimlik.org/",
s = Stack()
s.push('Ruby')
s.push('Perl')
s.push('Go')
while not s.isEmpty():
s.pop()
s.pop()
@seyyah
seyyah / h20131105.m
Last active December 27, 2015 11:49
Harita Mühendisliği Bölümü Bilgisayara Giriş Dersi, 2013-2014 Güz
clc
as = input('Arasinav');
ds = input('Final');
ort = as * 40/100 + ds * 60/100
clc
disp('Vucut-Kitle Index Hesaplama Programina Hosgeldiniz');
boy = input('Boyunuz: ');
kilo = input('Kilonuz: ');
@seyyah
seyyah / h20131022_if.m
Last active December 27, 2015 11:39
Harita Mühendisliği Bölümü Görsel Programlama Dersi, 2013-2014 Güz
- max
- mutlak
- BMI
- Hal (katı, sıvı, gaz)
- Ortalama: geçti, kaldı
@seyyah
seyyah / boncuk.m
Last active December 27, 2015 03:58
DIP LAB
clear all; close all; clc;
im = imread('http://i.imgur.com/TwDQZKO.jpg');
r = im(:,:, 1);
g = im(:,:, 2);
b = im(:,:, 3);
figure(1);
subplot(2,2,1); imshow(im); title('Boninon');
@seyyah
seyyah / 1) moodle2.5
Last active December 23, 2015 22:39
DOcs: Moodle2 kurulumu: apt php5-apc hata mesajı
# apt-get install php5-apc --reinstall
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
php5-apc
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
19 not fully installed or removed.
Need to get 0 B/70,4 kB of archives.
After this operation, 211 kB of additional disk space will be used.