Skip to content

Instantly share code, notes, and snippets.

function factorial(n) {
if (n < 2) {
return 1;
}
return n * factorial(n - 1);
}
WHERE u.UserName LIKE '%[^a-zA-Z0-9]%'
<html>
<head>
<!-- <title></title> -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<!-- <style></style> -->
<!-- <link rel="stylesheet" type="text/css" href=""> -->
</head>
<body>
@DorukUlucay
DorukUlucay / blockchain.cs
Last active May 18, 2018 13:10
my first blockchain implementation. also at https://github.com/DorukUlucay/dodchain
using System;
using System.Collections.Generic;
using System.Security.Cryptography;
using System.Text;
using System.Linq;
namespace DoDChain
{
public class Block
{
@DorukUlucay
DorukUlucay / for-else.py
Last active May 28, 2018 06:36
Python For-Else
# https://pyfiddle.io/fiddle/f479b511-7645-4a66-a434-be7a829f015d/?i=true
def isPrime(n):
for i in range(2,n):
if(n % i == 0):
print("asal degil")
break
else:
print("asal")
public static string StripNonNumeric(this string value)
{
var newVal = string.Empty;
foreach (var item in value)
{
var intVal = 0;
var res = int.TryParse(item.ToString(), out intVal);
if (res)
{
@DorukUlucay
DorukUlucay / UnitTests.cs
Last active May 29, 2022 10:11
TR Plaka Kodu C# REGEX
using Xunit;
namespace plaka.Tests
{
public class UnitTests
{
plaka.Core.Validator validator;
public UnitTests()
{
validator = new Core.Validator();
# Get current branches of dirs in a dir
function isAGitDir() {
if ((Test-Path ".git") -eq $TRUE) {
return $TRUE
}
return $FALSE
}
function gitCheck($path) {
$ git remote rm origin
$ git remote add origin [email protected]:aplikacjainfo/proj1.git
$ git config master.remote origin
$ git config master.merge refs/heads/master
@DorukUlucay
DorukUlucay / razor.md
Created June 25, 2019 14:25
Razor Code Snippets

Razor DropDownListFor

@Html.DropDownListFor(model => model.StuffId, new SelectList(ViewBag.StuffList, "Value", "Text"), "Please Select", new { required = "required" })

Razor TextBoxFor

@Html.TextBoxFor(x => x.SomeStuff, "", new { @class = "form-control", placeholder = "Type in some stuff here" })