This file contains hidden or 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
| module TcValidate | |
| def self.validate(tc, name, surname, birth) | |
| client = Savon.client(wsdl: 'https://tckimlik.nvi.gov.tr/Service/KPSPublic.asmx?WSDL') | |
| res = client.call(:tc_kimlik_no_dogrula, message: { 'TCKimlikNo' => tc.to_i, 'Ad' => name, 'Soyad' => surname, 'DogumYili' => birth.to_i }) | |
| res.body | |
| end | |
| end |
This file contains hidden or 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
| # frozen_string_literal: true | |
| class ApplicationRecord < ActiveRecord::Base | |
| def self.include_counts(assc) | |
| nm = table_name.singularize | |
| joins( | |
| %{ | |
| LEFT OUTER JOIN ( | |
| SELECT b.#{nm}_id, COUNT(*) #{assc}_count | |
| FROM #{assc} b |
This file contains hidden or 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 TrieNode | |
| attr_accessor :children, :end_of_word, :parent | |
| def initialize(parent) | |
| self.children = {} | |
| self.parent = parent | |
| self.end_of_word = false | |
| end | |
| end |
This file contains hidden or 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
| _uploadSnap() { | |
| var url = 'http://example.com/upload'; // File upload web service path | |
| var photo = { | |
| uri: this.state.picturePath, // CameralRoll Url | |
| type: 'image/jpeg', | |
| name: 'photo.jpg', | |
| }; | |
| var formData = new FormData(); | |
| formData.append("file", photo); |
This file contains hidden or 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 create_import(curr, files) | |
| Category.create(curr) | |
| subs = files.select { |i| i['parent_id'] == curr['id'] } | |
| subs.each { |cat| create_import(cat, files) } | |
| end | |
| def create_features(cat, features) | |
| fets = features.select do |i| | |
| i['category_ids'] == cat.id | |
| end |
This file contains hidden or 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
| $.fn.extend({ | |
| filedrop: function (options) { | |
| var defaults = { | |
| callback : null | |
| } | |
| options = $.extend(defaults, options) | |
| return this.each(function() { | |
| var files = [] | |
| var $this = $(this) |
This file contains hidden or 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 "google_drive" | |
| full_path = '/home/emrek/Desktop/Business/bafrahaber/public/' | |
| session = GoogleDrive::Session.from_config("config.json") | |
| files_path = full_path + Date.today.prev_day.strftime('%Y/%m/%d') | |
| def root_path | |
| #return 'Production' if Rails.env.production? | |
| 'Bafrahaber_dev' | |
| end |
This file contains hidden or 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
| package com.gui; | |
| import java.awt.FlowLayout; | |
| import java.awt.event.ActionEvent; | |
| import java.awt.event.ActionListener; | |
| import javax.swing.JButton; | |
| import javax.swing.JFrame; | |
| import javax.swing.JLabel; | |
| import javax.swing.JTextField; |
This file contains hidden or 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
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <unistd.h> | |
| void process_leaf(){ | |
| srand(getpid()); | |
| int r = rand()%100; | |
| char filename[20]; | |
| sprintf(filename,"%d.txt",getpid()); | |
| printf("r num gen :%d by %d\n",r,getpid()); |
This file contains hidden or 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
| #!/bin/bash | |
| today=`date +%Y-%m-%d_%H-%M` | |
| for i in /etc/nginx/sites-enabled/* | |
| do | |
| if [ $i != "/etc/nginx/sites-enabled/default" ] | |
| then | |
| path=`cat $i | grep -w root | awk '{print $2}' | sed 's/\public;//g'` | |
| path=$path"config/database.yml" |
NewerOlder