Skip to content

Instantly share code, notes, and snippets.

💭
🦈

M. Serhat Dundar msdundar

💭
🦈
Block or report user

Report or block msdundar

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@msdundar
msdundar / auth.py
Last active Apr 6, 2019
urllib.request.urlopen
View auth.py
#!/usr/bin/env python3.2
import os.path, urllib.request
from sys import exit
from time import sleep
# Hatalı girilen dosya yolunu düzelt
try:
yer = input("Dosyanın konumu: ").strip()
dosya_adi = input("Dosyanın ismi: ").strip()
View sessions_controller.rb
# frozen_string_literal: true
module Account
class SessionsController < Devise::SessionsController
layout 'guest'
def after_sign_out_path_for(_resource_or_scope)
login_path
end
end
View address.rb
# frozen_string_literal: true
class Address < ApplicationRecord
self.inheritance_column = nil
# virtual attributes
attr_accessor :country
# enums
enum type: { formal: 1, informal: 2 }
View error.log
Traceback (most recent call last):
44: from bin/rails:6:in `<main>'
43: from /home/msdundar/projects/nokul/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
42: from /home/msdundar/projects/nokul/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
41: from /home/msdundar/projects/nokul/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.0/lib/bootsnap/load_path_cache/loaded_features_index.rb:83:in `register'
40: from /home/msdundar/projects/nokul/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
39: from /home/msdundar/projects/nokul/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
38: from /home/msdundar/projects/nokul/vendor/bundle/ruby/2.6.0/bundler/gems/rails-af6ade0cfd09/railties/lib/rails/commands.r
View nokul.sh
#!/bin/bash
guake --rename-tab="home"
guake -n "whatever" -r "server" -e "cd ~/projects/nokul && rails s"
guake -n "whatever" -r "console" -e "cd ~/projects/nokul && rails c"
guake -n "whatever" -r "sidekiq" -e "cd ~/projects/nokul && bundle exec sidekiq -q urgent"
guake -n "whatever" -r "git" -e "cd ~/projects/nokul && git status"
exit 0
@msdundar
msdundar / kps.rb
Created Jan 24, 2014
KPS SOAP Client
View kps.rb
# 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/",
View ttsms.rb
# coding: utf-8
require 'savon'
# Konfigürasyon
client = Savon.client(
wsdl: "http://ws.ttmesaj.com/service1.asmx?WSDL",
soap_version: 2,
)
# Sorgulama Request
@msdundar
msdundar / YSK-Dogrulama.js
Created Dec 25, 2013
YSK'nın kullandığı T.C. doğrulama
View YSK-Dogrulama.js
/*
-------------------------------------------------------------------------
JavaScript Form Validator
Version 2.0.2
Copyright 2003 JavaScript-coder.com. All rights reserved.
You use this script in your Web pages, provided these opening credit
lines are kept intact.
The Form validation script is distributed free from JavaScript-Coder.com
You may please add a link to JavaScript-Coder.com,
@msdundar
msdundar / kur-gonder.php
Last active Dec 30, 2015
Doviz.com bilgilendirme servisi adam akıllı çalışmadığı ve kurları abuk subuk gösterdiği için basit bir betik hazırladım. Kuru merkez bankasından öğreniyor, mevcut paranıza göre kaç lira kar ettiniz veya ne kadar zarardasınız hesaplayıp size günlük kurla birlikte e-mail gönderiyor. Cron'a bağlarsanız sayfayı istediğiniz aralıkta çağırarak size m…
View kur-gonder.php
<?php
# Merhaba merkes bankasi
$doviz = new Doviz();
echo $doviz->Alis('DKK') . "\n";
echo $doviz->Satis('DKK') . "\n";
class Doviz{
public $XML;
View start.js
<% @diff = ((vize.start - Time.current).to_i + @current_student.id % 60) %>
<script type="text/javascript">
$(document).ready(function() {
$("#countdown_dashboard2").countDown({
targetOffset: {
'day':0,'month':0,'year':0,
'hour':<%= (@diff / 3600) %>,
'min':<%= (@diff / 60) % 60 %>,
'sec':<%= @diff % 60 %>
You can’t perform that action at this time.