Skip to content

Instantly share code, notes, and snippets.

Avatar
👨‍💻
Code^Game^Sleep > Bermuda Triangle

OMANSAK omansak

👨‍💻
Code^Game^Sleep > Bermuda Triangle
View GitHub Profile
@omansak
omansak / oracle-generate-class-from-table.sql
Last active Jun 17, 2022
Oracle DB Generate Class From Table
View oracle-generate-class-from-table.sql
/*
______________________________________________________________________
| ORACLE DATABASE DATA TYPE | NET TYPE ALIAS | NETDATATYPE |
|----------------------------|----------------|----------------------|
| NUMBER1 | BOOL | SYSTEM.BOOLEAN |
| NUMBER2TONUMBER4 | BYTE | SYSTEM.BYTE |
| NUMBER5 | SHORTINT16 | SYSTEM.INT16 |
| NUMBER6TONUMBER10 | INTINT32 | SYSTEM.INT32 |
| NUMBER11TONUMBER19 | LONGINT64 | SYSTEM.INT64 |
| NUMBERGT19 | DECIMAL | SYSTEM.DECIMAL |
@omansak
omansak / net-core-password-hash.cs
Created Oct 23, 2021
.NET Core Password Hash (C#)
View net-core-password-hash.cs
public class PasswordHasher
{
/// <summary>
/// Size of salt.
/// </summary>
private const int SaltSize = 16;
/// <summary>
/// Size of hash.
/// </summary>
@omansak
omansak / sqlserver-generate-class-from-table.sql
Last active Nov 8, 2021
SQLServer (MSSql) Generate Class From Table
View sqlserver-generate-class-from-table.sql
declare @TableName sysname = 'LOGIN'
declare @Result varchar(max) ='[Table("'+@TableName+'")]' +'
public class ' + @TableName + '
{'
select @Result = @Result + ' [Column("'+ replace(ColumnName, ' ', '_') +'")]' +'
public ' + ColumnType + NullableSign + ' ' + ColumnName + ' { get; set; }
'
from
(
@omansak
omansak / OracleQueryBuilder.cs
Last active Feb 7, 2020
Oracle Query Builder writen C# / .NET. (Stored Procedure,Functions,Tables,Queries)
View OracleQueryBuilder.cs
using Oracle.ManagedDataAccess.Client;
using System;
using System.Collections.Generic;
using System.Data;
using System.Diagnostics;
using System.Linq;
using System.Text;
namespace MSU.Recourse.Extensions
{
@omansak
omansak / ValueReferenceType.cs
Last active Sep 4, 2019
C# Value Type and Reference Type | In C#, these data types are categorized based on how they store their value in the memory (string vs StringBuilder || struct vs class)
View ValueReferenceType.cs
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
public class Program
{
static void Main(string[] args)