Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Tufan Barış Yıldırım tufanbarisyildirim

🎯
Focusing
View GitHub Profile
View fnv-benchmark.md

Before Inlining

BenchmarkNextHash-16                    12962270                83.4 ns/op            20 B/op          2 allocs/op

After Inlining

BenchmarkNextHash-16                    32723619                33.9 ns/op             0 B/op          0 allocs/op
@tufanbarisyildirim
tufanbarisyildirim / hash.go
Last active Apr 29, 2020
zero allication fnv hashing of #golang
View hash.go
// https://github.com/golang/go/blob/master/src/hash/fnv/fnv.go#L100 the code we previously used
// has some allocations
// we need minimum footprint per deciding
func findIndex(s string, poolSize uint32) uint32 {
var h32a uint32 = 2166136261
for _, c := range []byte(s) {
h32a *= 16777619
h32a ^= uint32(c)
}
View verifyblockchain
Verifying that +tfnyldrm is my blockchain ID. https://onename.com/tfnyldrm
View full-ffmpeg.sh
# Add multimedia source
echo "deb http://www.deb-multimedia.org wheezy main non-free" >> /etc/apt/sources.list
echo "deb-src http://www.deb-multimedia.org wheezy main non-free" >> /etc/apt/sources.list
apt-get update
apt-get install deb-multimedia-keyring # if this aborts, try again
apt-get update
# Go to local source directory
cd /usr/local/src
View SqlClassGenerator.tt
<#@ assembly name ="System.Data" #>
<#@ assembly name ="System.Xml" #>
<#@ import namespace="System.Collections.Generic" #>
<#@ import namespace="System.Data.SqlClient" #>
<#@ import namespace="System.Data" #>
<#@ import namespace="System.Text" #>
<#+
class SQLClassGenerator
{
Dictionary<Type, string> _alias = new Dictionary<Type, string>();
@tufanbarisyildirim
tufanbarisyildirim / ServiceJsonAdapter.cs
Last active Dec 24, 2015
an http module example to publish .net asmx webservices as a restful service.
View ServiceJsonAdapter.cs
using System;
using System.Web;
using System.Reflection;
using System.Linq;
using System.Collections.Specialized;
using System.Collections.Generic;
namespace ServiceTest
{
public class ServiceJsonAdapter : IHttpHandler
@tufanbarisyildirim
tufanbarisyildirim / Kefukar.Dotnet.cs
Last active Dec 17, 2015
php DOTNET sınıfına bir örnerk
View Kefukar.Dotnet.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Kefukar
{
public class Dotnet
{
@tufanbarisyildirim
tufanbarisyildirim / GenericExtensions.cs
Last active Dec 16, 2015
select list items by using print page like string
View GenericExtensions.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
// TODO: check out of page ranges.
public static class GenericExtensions
{
public static List<T> PrintPagesFilter<T>(this List<T> list, string pattern)
{
@tufanbarisyildirim
tufanbarisyildirim / ImageExtensions.cs
Created Apr 10, 2013
OCR Extension metod for System.Drawing.Image using MODI
View ImageExtensions.cs
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using System.IO;
using System.Drawing.Imaging;
namespace Extensions
{
public static class ImageExtensions
View DataTableToExcel.cs
public string DataTableToWorkBook(DataTable dt, string postfix)
{
object oMissing = Missing.Value;
Microsoft.Office.Interop.Excel.Application app;
Microsoft.Office.Interop.Excel.Workbooks wkBks;
Microsoft.Office.Interop.Excel.Workbook wkBk;
Microsoft.Office.Interop.Excel.Sheets wkShts;
Microsoft.Office.Interop.Excel.Worksheet wkSht;