Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View ozgun's full-sized avatar

Ozgun Koyun ozgun

View GitHub Profile
@ozgun
ozgun / folding.java
Created February 10, 2014 13:23
IntelliJ IDEA folding example
public void init() {
//Execute a job on the event-dispatching thread; creating this applet's GUI.
try {
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
buffer = new StringBuffer();
}
});
} catch (Exception e) {
@ozgun
ozgun / build.xml
Created February 19, 2014 09:37
Japa Applet'i için ant build.xml
<?xml version="1.0" encoding="UTF-8"?>
<project name="Smartcard Login Applet" default="sign">
<!-- MANIFEST.MF dosyasındaki Application-Name alanının değeri -->
<property name="app.name" value="Smartcard Login Applet" />
<!-- Name of the output .jar file -->
<property name="jar.name" value="yh-smartcard-login.jar" />
<!-- Main class -->
@ozgun
ozgun / cronttab
Last active August 29, 2015 13:58
cronttab
# Eğer rvm kullanılıyorsa kullanıcı için default rvm'in set edilmiş olması gerekiyor.
# O da şu komutla yapılır: rvm use 1.9.3-p125 --default
10 15 * * * /bin/bash -l -c 'cd /home/ozgun/rails_app/current && bundle exec rake sys:update_currencies RAILS_ENV=production'
@ozgun
ozgun / protected_method_example.rb
Created July 3, 2014 07:37
Protected method example
class A
protected
def p1
"p1"
end
end
@ozgun
ozgun / datetimepicker_range.html.erb
Last active August 29, 2015 14:03
datetimepicker range örneği
<!-- jQuery ve jQuery-ui gerekli -->
<!-- Kullanılan plugin: https://github.com/trentrichardson/jQuery-Timepicker-Addon -->
<!-- yüklenmesi gereken javascript dosyaları: jquery-ui-timepicker-addon.js ve jquery-ui-timepicker-tr.js -->
<!-- CSS dosyaları da gerekli -->
<script>
$(document).ready(function() {
$.datepicker.setDefaults( $.datepicker.regional[ "" ] );
@ozgun
ozgun / dashboard.json
Last active August 29, 2015 14:04
dashboard.json
{"parked_vehicles":{"chart1":{"total":562,"in_park":266,"left_park":296},"chart2":{"total":296,"paid":188,"unpaid":108},"chart3":{"total":108,"runaway":47,"subscriber":22,"free_of_charge":39}},"profit":{"total":8451,"ratio":0},"loss":{"total":935,"ratio":935}}
@ozgun
ozgun / end_date_validator.rb
Last active August 29, 2015 14:04
Validator: Bitiş tarihinin başlangıç tarihinden sonra olup olmadığını doğrular
# Bitiş tarihinin başlangıç tarihinden sonra olup olmadığını kontrol eden validator.
#
# Başlangıç tarihinin attribute'u "start_date_field" parametresi ile gönderilir.
#
# == Example:
#
# class Subscription
# validates :end_date, end_date: { start_date_field: :start_date }
# end
#
@ozgun
ozgun / .xsessionrc
Created August 4, 2014 17:16
~/.xsessionrc dosyası: X'e login olduktan sonra okunan dosya
#!/bin/bash
# Hangi desktop secilerek login olunursa olunsun bu okunuyor ve bu dosyadaki
# programlar calistiriliyor.
# xmonad'da login olduktan sonra bu dosya okunuyor. Kontrol etmek için
# aşağıdaki touch komutu kullanılabilir.
#/usr/bin/touch /tmp/xsession-touch
/usr/bin/gnome-keyring-daemon &
@ozgun
ozgun / fonts.txt
Created August 5, 2014 13:18
fonts
$ ls -lh app/assets/fonts/
total 3,7M
-rwxrwxr-x 1 ozgun ozgun 20K Haz 23 12:21 glyphicons-halflings-regular.eot
-rwxrwxr-x 1 ozgun ozgun 62K Haz 23 12:21 glyphicons-halflings-regular.svg
-rwxrwxr-x 1 ozgun ozgun 41K Haz 23 12:21 glyphicons-halflings-regular.ttf
-rwxrwxr-x 1 ozgun ozgun 23K Haz 23 12:21 glyphicons-halflings-regular.woff
-rwxrwxr-x 1 ozgun ozgun 67K Haz 30 19:49 inconsolata-bold.eot
-rwxrwxr-x 1 ozgun ozgun 106K Haz 30 19:49 inconsolata-bold.svg
-rwxrwxr-x 1 ozgun ozgun 66K Haz 30 19:49 inconsolata-bold.ttf
-rwxrwxr-x 1 ozgun ozgun 33K Haz 30 19:49 inconsolata-bold.woff
@ozgun
ozgun / unicorn.rb
Created March 25, 2015 15:37
unicorn config
worker_processes 2
preload_app true
timeout 30
app_name = "myapp"
app_dir = "/home/ozgun/#{app_name}"
working_directory "#{app_dir}/current"
listen "#{app_dir}/shared/tmp/unicorn.sock", :backlog => 64
#listen "/tmp/unicorn.sock", :backlog => 64