Skip to content

Instantly share code, notes, and snippets.

View berkayakcay's full-sized avatar
🍀
Knockin’ On Heaven’s Door

Berkay Akçay berkayakcay

🍀
Knockin’ On Heaven’s Door
View GitHub Profile
@berkayakcay
berkayakcay / postgres-update-and-insert-into-with-returning.sql
Created September 13, 2018 11:28
PostgreSQL UPDATE table and get ids from UPDATED rows then INSERT INTO another table
/*
PostgreSQL
If you want to insert any column retaled with update query you can use this.
It gets ids from updated tables and then inter them into another table.
*/
with rows AS (
UPDATE product SET price = price * 1.10
RETURNING id
)
@berkayakcay
berkayakcay / Readme.md
Last active September 4, 2017 00:36
Readme Template

Project Name

TODO: Write a project description

Screenshot software

Installation

TODO: Describe the installation process

Usage

TODO: Write usage instructions

Contributing

%{ Filters
% near 2 | 4 | 6
%
% mean
% (4,4) (4,5) (4,6)
% (5,4) (5,5) (5,6)
% (6,4) (6,5) (6,6)
%
% %}
clc; clear; close all;
%ream images
firstImg = imread('c.png');
firstImg = double(firstImg);
secondImg = imread('c2.png');
secondImg = double(secondImg);
%define distance from pixel
distance2point = 5;
@berkayakcay
berkayakcay / RequestHurriyetApi.cs
Created September 10, 2016 16:44
Hürriyet Api C#
try
{
string uri = "https://api.hurriyet.com.tr/v1/newsphotogalleries;
HttpWebRequest request = WebRequest.Create(uri) as HttpWebRequest;
request.Method = "GET";
request.Headers.Add("apikey: YOUR_API_KEY");
string stringResponse = string.Empty;
using (HttpWebResponse response = request.GetResponse() as HttpWebResponse)
@berkayakcay
berkayakcay / ActiveDirectoryCSVExport.cs
Last active July 20, 2016 08:24
Active Directory CSV Export C#
string domainName = "YOUR_DOMAIN_NAME";
string cvspath = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "\\ActiveDirectoryList_" + Guid.NewGuid().ToString() + ".csv";
StringBuilder cvscontent = new StringBuilder();
cvscontent.AppendLine("SAMAccountName, givenName, sn, title, department, samAccountName, userPrincipalName");
using (var context = new PrincipalContext(ContextType.Domain, domainName))
{
using (var searcher = new PrincipalSearcher(new UserPrincipal(context)))
{
foreach (var result in searcher.FindAll())