Skip to content

Instantly share code, notes, and snippets.

View mahmut-gundogdu's full-sized avatar

Mahmut Gundogdu mahmut-gundogdu

View GitHub Profile
@mahmut-gundogdu
mahmut-gundogdu / gist:5356059
Last active December 16, 2015 01:30 — forked from anonymous/gist:4995091
...
//CPU ID
string sQuery = "SELECT ProcessorId FROM Win32_Processor";
ManagementObjectSearcher oManagementObjectSearcher = new ManagementObjectSearcher(sQuery);
ManagementObjectCollection oCollection = oManagementObjectSearcher.Get();
foreach (ManagementObject oManagementObject in oCollection)
{
sProcessorID = (string)oManagementObject["ProcessorId"];
}
//HDD ID
@mahmut-gundogdu
mahmut-gundogdu / gist:5569343
Created May 13, 2013 15:52
ios zoom sorunu çözümü
<meta name="viewport" content="width=640, initial-scale=1, maximum-scale=1">
@mahmut-gundogdu
mahmut-gundogdu / gist:5728340
Created June 7, 2013 10:14
asp.net hata yönetimi. Hatanın serilize edilerek kaydedilmesi. kaynak : http://www.canbatuerdem.com/asp-net-exception-serialization/
using System;
using System.Collections;
using System.Collections.Specialized;
using System.Reflection;
using System.Web;
using System.Text;
namespace CANBATUERDEM
{
public static class ExcepitonExtensions
@mahmut-gundogdu
mahmut-gundogdu / gist:5781967
Created June 14, 2013 13:53
excel olmasa da c sharp ile excele sql sorgumuzun sonucunu hariç etmek. bu kodun çalışması için CarlosAg.ExcelXmlWriter.dll dosyası gerekmekedir.
private Task<DataTable> db()
{
return Task.Run(() =>
{
SqlConnection baglan = new SqlConnection("Server=.\\sqlexpress;Database=eczanem;Trusted_Connection=True;");
string sorgu = textBox1.Text;
SqlDataAdapter adp = new SqlDataAdapter(sorgu, baglan);
DataTable dt = new DataTable();
adp.Fill(dt);
@mahmut-gundogdu
mahmut-gundogdu / gist:5813791
Last active April 23, 2020 16:07
asp.net için ckeditor resim upload (yükleme) kontrolü kodları
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="test.aspx.cs" Inherits="VAD.test" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script src="Scripts/jquery-1.9.1.min.js"></script>//jquery dosyamız
<script type="text/javascript" src="ckeditor/ckeditor.js"></script>//ckeditor dosyamız
@mahmut-gundogdu
mahmut-gundogdu / gist:5875174
Created June 27, 2013 09:27
asp.net kendi kontrolümüzü yazarken değişkenlerin postback olduktan sonra null olmaması için viewstate de saklanam durumu.
protected override object SaveViewState()
{
//bu fonksyion ile viewstate i kaydediyoruz
object[] controlState = new object[4];
controlState[0] = base.SaveViewState(); //kontrolün kendi viewstateleri
controlState[1] = this.baslangic;//bizim degiskenimiz
controlState[2] = this.bitis;//bizim degiskenimiz
controlState[3] = this.coklu;//bizim degiskenimiz
CREATE PROCEDURE [dbo].[usp_Create_Table_DDLs]
(
@sTable_Name SYSNAME,
@Create_Table_Ind BIT = 1,
@PK_Ind BIT = 1,
@FK_Ind BIT = 1,
@Check_Ind BIT = 1,
@Default_Ind BIT = 1
)
AS
@mahmut-gundogdu
mahmut-gundogdu / GolgelerinGucu
Last active August 29, 2015 14:02
Narayana Vyas Kondreddi (http://vyaskn.tripod.com) abimizin kodu ile (saklı yordam) ile istediğimz tablodaki kayıtların insert sorgusunu almak mümkün. Kulanışlı ve alet cantamızda olması gereklerden. Kullanımı EXEC sp_generate_inserts 'tabloAdi'
CREATE PROC sp_generate_inserts
(
@table_name varchar(776), -- The table/view for which the INSERT statements will be generated using the existing data
@target_table varchar(776) = NULL, -- Use this parameter to specify a different table name into which the data will be inserted
@include_column_list bit = 1, -- Use this parameter to include/ommit column list in the generated INSERT statement
@from varchar(800) = NULL, -- Use this parameter to filter the rows based on a filter condition (using WHERE)
@include_timestamp bit = 0, -- Specify 1 for this parameter, if you want to include the TIMESTAMP/ROWVERSION column's data in the INSERT statement
@debug_mode bit = 0, -- If @debug_mode is set to 1, the SQL statements constructed by this procedure will be printed for later examination
@owner varchar(64) = NULL, -- Use this parameter if you are not the owner of the table
@ommit_images bit = 0, -- Use this parameter to generate INSERT statements by omitting the 'image' columns
@mahmut-gundogdu
mahmut-gundogdu / MultiMarkerMultiInfoWindow
Last active August 29, 2015 14:03
Google map ile bir den çok noktanın harita üzerinde görünmesi örneği. Burada veri kaynağından (örnekte json) gelen kordinatları marker ile harita üzerinden işaretleyip, infoWindow ile üzerine tıklandığında html bilgi ile görüntülenmesi sağlandı. Kafanıza takılan bir sey olursa mahmutgundogdu at hotmail com tr den bana ulaşabilirsiniz.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<title></title>
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp"></script>
<script type="text/javascript" >
var map;
var marker;
var infowindow;
@mahmut-gundogdu
mahmut-gundogdu / kullanici.cs
Last active August 29, 2015 14:04
Dotliquid ile temiz ve kolay mail template olusturma - Yazi:http://mahmutgundogdu.azurewebsites.net/?p=230
//Bu kodlar ile txt dosyasından aldık. Böylece Taslak Değişeceği zaman template.html değiştirmek yeterli.
TextReader txt = File.OpenText(Server.MapPath("~/App_Data/template.html"));
var strTemplate=txt.ReadToEnd();
txt.Close();
txt.Dispose();
//Adim 1. Templatei verdik.
Template template = Template.Parse(strTemplate);
//Veri Normalde bu database den gelir ben kendim olusturdum.