Skip to content

Instantly share code, notes, and snippets.

View hazzik's full-sized avatar

Alex Zaytsev hazzik

  • Brisbane, Australia
View GitHub Profile
@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/>
using System;
using System.Linq.Expressions;
using System.Reflection;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
namespace FastGetMethodBenchmark
{
public class FastGetMethodVsGetMethod
{
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Data.Entity.ModelConfiguration;
using System.Data.Entity.ModelConfiguration.Configuration;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using DelegateDecompiler;
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;
-pascalCase+
-nativeTypeSystem
-organizeUsings
-separateInterfaceConstants
-junitConversion
-maxColumns 400
-namespaceMapping org.mozilla.javascript Rhino
-fullyQualify Cipher
@hazzik
hazzik / Output.txt
Last active December 25, 2015 03:49
SelectMany performance
Compiling the source code....
$mcs main.cs -out:demo.exe 2>&1
main.cs(37,13): warning CS0219: The variable `ids1' is assigned but its value is never used
main.cs(40,13): warning CS0219: The variable `ids1' is assigned but its value is never used
Compilation succeeded - 2 warning(s)
Executing the program....
$mono demo.exe
SelectMany method chain : 00:00:00.7027228
SelectMany linq : 00:00:00.6438793
[].concat(
Object.getOwnPropertyNames(Object),
Object.getOwnPropertyNames(window)
).map(function(x){return {name:x,length:JSFuck.encode(x).length};})
.sort(function(x,y) {return x.length-y.length;})
.forEach(function(x) {console.log(x);})
public static class EnumerableEx
{
public static bool Any(this IEnumerable e)
{
using (var i = enumerable.GetEnumerator())
{
return i.MoveNext();
}
}
def using (v, &block)
begin
block.call
ensure
v.close unless v.nil? if v.class.method_defined? :close
end
end
class Resource
def name ()
if (!document.getElementsByClassName) {
document.getElementsByClassName = function(search) {
var d = document, elements, pattern, i, results = [];
if (d.querySelectorAll) { // IE8
return d.querySelectorAll("." + search.replace(/\s+/g, '.'));
}
if (d.evaluate) { // IE6, IE7
pattern = ".//*[contains(concat(' ', @class, ' '), ' " + search + " ')]";
elements = d.evaluate(pattern, d, null, 0, null);
while ((i = elements.iterateNext())) {