Skip to content

Instantly share code, notes, and snippets.

View hazzik's full-sized avatar

Alex Zaytsev hazzik

  • Brisbane, Australia
View GitHub Profile
using System;
using System.Net;
using System.Net.Sockets;
using System.Threading;
class Program
{
static void Main()
{
for (int i = 0; i < 1000; i++)
$file = Get-Content ".\bower.json"
$component = "$file" | ConvertFrom-Json
$jquery = $component.dependencies.jquery.replace('>=', '')
echo "<?xml version=""1.0""?>
<package xmlns=""http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"">
<metadata>
<version>$($component.version).$env:BUILD_NUMBER</version>
<authors>Chris Wanstrath, Joshua Peek</authors>
<owners>hazzik</owners>
<licenseUrl>https://github.com/defunkt/jquery-pjax/blob/master/LICENSE</licenseUrl>
@hazzik
hazzik / ex1.cs
Last active August 29, 2015 14:27
NHibernateQuery
interface IQuery<TCriteria, TResult> { TResult Execute(TCriteria criteria); }
class BooksWithISBN { public string ISBN { get; set; } }
class BooksWithISBNQuery : IQuery<BooksWithISBN, IEnumerable<Book>> {
public IEnumerable<Book> Execute(BooksWithISBN criteria) {
return session.Query<Book>().Where(b => b.ISBN == criteria.ISBN).AsEnumerable();
}
}
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using NUnit.Framework;
public class CachingEnumerable<T> : IEnumerable<T>, IDisposable
{
List<T> _cache;
using System;
using System.Linq.Expressions;
using System.Reflection;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
namespace FastGetMethodBenchmark
{
public class FastGetMethodVsGetMethod
{
@hazzik
hazzik / mount_ntfs_3g.plist
Last active February 6, 2022 00:27 — forked from zhylmzr/mount_ntfs_3g.plist
automount all ntfs volume writable in macOS Big Sur+
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>mount_ntfs_3g</string>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<false/>