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 / bs3-login-form.html
Last active August 27, 2015 12:58 — forked from bMinaise/bs3-login-form.html
Bootstrap 3 - Login Form Example From: http://bootsnipp.com
<div class="container">
<div class="row">
<div class="col-sm-6 col-md-4 col-md-offset-4">
<h1 class="text-center login-title">Sign in to continue to Bootsnipp</h1>
<div class="account-wall">
<img class="profile-img" src="https://lh5.googleusercontent.com/-b0-k99FZlyE/AAAAAAAAAAI/AAAAAAAAAAA/eu7opA4byxI/photo.jpg?sz=120"
alt="">
<form class="form-signin">
<input type="text" class="form-control" placeholder="Email" required autofocus>
<input type="password" class="form-control" placeholder="Password" required>
@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.
@mahmut-gundogdu
mahmut-gundogdu / Ayarlar.cs
Created July 18, 2014 13:49
Nosql biggy ile asp.net de sabit verilerin ve uygulama ayarlarının saklanması. http://mahmutgundogdu.azurewebsites.net/?p=242
using Biggy;
using Biggy.JSON;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace AYarlar
{
public class Firma
@mahmut-gundogdu
mahmut-gundogdu / Çözüm 1
Last active August 29, 2015 14:04
SqlDataReader ve null gelen veri sorununa prait çözümler. Çözüm 1: SqlDataReader için generic extension olusturulur. Çözüm 2: de bir static fonksiyon olusturulur. Bu fonksiyon null ile default değeri gönderir yoksa convert ederek verir.Convert.ToInt32() yerine düşünün. Çözüm 3: c# ?? operatörü.
//Kaynak: http://stackoverflow.com/questions/18550769/sqldatareader-best-way-to-check-for-null-values-sqldatareader-isdbnull-vs-dbnul
using System;
using System.ComponentModel;
using System.Data.SqlClient;
public static class SqlReaderHelper
{
private static bool IsNullableType(Type theValueType)
<asp:DataPager ID="DataPagerProducts" runat="server" PagedControlID="LvCategoryItems" PageSize="10" OnPreRender="PagerCategoryItems_PreRender" class="btn-group pager-buttons">
<Fields>
<asp:NextPreviousPagerField ShowLastPageButton="False" ShowNextPageButton="False" ButtonType="Button" ButtonCssClass="btn" RenderNonBreakingSpacesBetweenControls="false" />
<asp:NumericPagerField ButtonType="Button" RenderNonBreakingSpacesBetweenControls="false" NumericButtonCssClass="btn" CurrentPageLabelCssClass="btn disabled" NextPreviousButtonCssClass="btn" />
<asp:NextPreviousPagerField ShowFirstPageButton="False" ShowPreviousPageButton="False" ButtonType="Button" ButtonCssClass="btn" RenderNonBreakingSpacesBetweenControls="false" />
</Fields>
</asp:DataPager>
@mahmut-gundogdu
mahmut-gundogdu / a.sql
Last active August 29, 2015 14:23
Sql server Veritabanındaki tüm kayıtları silmek. Kaynak: http://stackoverflow.com/a/16765160/3928982
CREATE PROCEDURE [dbo].[deleteAllDataFromAllTables] AS
SET NOCOUNT ON
DECLARE @dropAndCreateConstraintsTable TABLE ( DropStmt varchar(max) , CreateStmt varchar(max) )
insert @dropAndCreateConstraintsTable select
DropStmt = 'ALTER TABLE [' + ForeignKeys.ForeignTableSchema +
'].[' + ForeignKeys.ForeignTableName +
'] DROP CONSTRAINT [' + ForeignKeys.ForeignKeyName + ']; '
, CreateStmt = 'ALTER TABLE [' + ForeignKeys.ForeignTableSchema +
@mahmut-gundogdu
mahmut-gundogdu / gist:d9a524b8af3ae51ea5a1
Created November 9, 2015 12:01
MySQL Slugify Function kullanımı (Bence seo url de lazım olabilir. http://tanerdogan.com/mysql/mysql-slugify-function
DROP FUNCTION IF EXISTS slugify;
DELIMITER ;;
CREATE DEFINER='root'@'localhost'
FUNCTION slugify (temp_string VARCHAR(200) CHARSET utf8)
RETURNS VARCHAR(200)
DETERMINISTIC
BEGIN
DECLARE x, y , z Int;
DECLARE new_string VARCHAR(200);
DECLARE is_allowed Bool;
@mahmut-gundogdu
mahmut-gundogdu / gist.js
Created November 18, 2015 09:23
Form datasını jquery ile javascript objecte (dolayısı ile istersek json a) dönüştürmek
var formData = {};
$(".form-secici").serializeArray().map(function (x) { formData[x.name] = x.value; });