This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Linq.Expressions; | |
public static class QueryableExtensions | |
{ | |
public static IQueryable<T> WhereIf<T>(this IQueryable<T> queryable, bool condition, Expression<Func<T, bool>> predicate) | |
{ | |
return condition ? queryable.Where(predicate) : queryable; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#If MouseIsInvolumecontrolarea() and not WinActive("ahk_class TscShellContainerClass") | |
WheelUp::Send {LControl down}#{Right}{LControl up} | |
WheelDown::Send {LControl down}#{Left}{LControl up} | |
#If | |
MouseIsInvolumecontrolarea() | |
{ | |
CoordMode, Mouse, Screen | |
MouseGetPos, xpos, ypos | |
if (ypos > A_ScreenHeight-60 and xpos <= A_ScreenWidth-500) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let locale = "ru" | |
let langmap = "Ё|АFБ<ВDГUДLЕTЖ:ЗPИBЙQКRЛKМVНYОJПGРHСCТNУEФAХ{ЦWЧXШIЩOЪ}ЫSЬMЭ\"Ю>ЯZаfб\\,вdгuдlеtж\\;зpиbйqкrлkмvнyоjпgрhсcтnуeфaх[цwчxшiщoъ]ыsьmэ'ю.яzё\\№#" | |
let qmark m = ["https://mail.google.com"] | |
let qmark g = ["https://github.com/grandsilence?tab=repositories"] | |
let qmark n = ["https://github.com/new"] | |
let qmark h = ["https://www.cheatography.com/yograf/cheat-sheets/cvim/"] | |
let blacklists = ["https://console.hetzner.cloud/*","http://trans-energo36.ru/*","https://2doom.itch.io/*","https://music.yandex.ru/*"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Target Name="AfterBuild"> | |
<!-- the ILMergePath property points to the location of ILMerge.exe console application --> | |
<Exec Command="$(ILMergeConsolePath) /target=winexe /ndebug=false /targetplatform=v4 /wildcards bin\Release\App.exe ^ | |
/out:bin\Release\App_merged.exe ^ | |
bin\Release\*.dll" /> | |
</Target> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static T? DeepCopy<T>(this T self) where T : class | |
{ | |
if (!typeof(T).IsSerializable) | |
throw new ArgumentException("Type must be serializable"); | |
if (ReferenceEquals(self, null)) | |
return default; | |
var formatter = new BinaryFormatter(); | |
using var stream = new MemoryStream(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Don't track me Google | |
// @namespace Rob W, Grand Silence | |
// @description Removes the annoying link-conversion at Google Search/maps/... The Referrer is also hidden to improve your privacy. Designed for Firefox and Google Chrome. | |
// @version 3.7 | |
// @match *://*.google.com/* | |
// @match *://*.google.ad/* | |
// @match *://*.google.ae/* | |
// @match *://*.google.com.af/* | |
// @match *://*.google.com.ag/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<#@ template language="C#" #> | |
using System.Reflection; | |
using System.Runtime.InteropServices; | |
// General Information about an assembly is controlled through the following | |
// set of attributes. Change these attribute values to modify the information | |
// associated with an assembly. | |
[assembly: AssemblyTitle("Project")] | |
[assembly: AssemblyDescription("")] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Telegram has 4096 limit per message. So use chunkSize = 4096. | |
public static IEnumerable<string> ChunkUnicode(this string self, int chunkSize) | |
{ | |
if (string.IsNullOrEmpty(self)) | |
return Enumerable.Empty<string>(); | |
if (chunkSize < 4) | |
throw new ArgumentException("Minimum chunk size is 4.", nameof(chunkSize)); | |
var results = new List<string>(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public static $currencies = false; | |
public static function getCurrenciesJson() | |
{ | |
if (!self::$currencies) { | |
$json = json_decode(system::GET('http://www.floatrates.com/daily/rub.json'), true); | |
self::$currencies = !empty($json) ? $json : false; | |
} | |
return self::$currencies; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var keyboard = new InlineKeyboardMarkup(new InlineKeyboardButton[][] | |
{ | |
new [] { | |
new InlineKeyboardButton { | |
Text ="Текст для первой кнопки", | |
CallbackData = "cb1" | |
}, | |
}, | |
}); |
NewerOlder