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
' - Scrivener has a host of bugs and is rarely updated--this document will be my knowledge share with my writing on how I've worked around this. | |
' - Always compile to rtf. | |
' - Load rtf in word. | |
' - Save as docx. | |
' - Open print dialog and close it to force table of contents to update. | |
' - Paperback 6x9 margins: all 0.75, except outside is 0.45, gutter 0.13 | |
' - Paperback 6x9 custom size 6x9 | |
' - Paperback 6x9 layout header/footer 0.5 | |
' - Highlight all text in footers, open layout -> paragraph -> check keep lines together | |
' - On the File tab, go to Options > Customize Ribbon. Under Customize the Ribbon and under Main Tabs, select the Developer check box. |
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
function truncateTextWithEllipsis(selector, text, maxHeight) | |
{ | |
var el = $(selector); | |
el.text(text); | |
if (el.height() > maxHeight) | |
{ | |
//console.log('Start shrink ' + text); | |
while (el.height() > maxHeight && text.length > 0) | |
{ |
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
// | |
// code used on https://dailytechnews.io to fade images | |
// MIT license, no support provided :) | |
// | |
// Setup: | |
// - you must put your img tag inside a span tag and set the img tag css to display: none. Make sure the css for the span and img tag has a height set. Width can be 100%. | |
// - query on all cross-fade spans in a script at the end of your body tag and call DailyTechNewsIoFade(eachSpan) for each one | |
// - i.e. _loop('.cross-fade', DailyTechNewsIoFade); | |
// - required html markup: <span class='cross-fade'><img class='your-image-class' src='/path/lowres/image.webp' title='title' alt='alt' data-src='/path/highres/image.webp' data-dim='1.5' /></span> | |
// - the src is a very low res image (32x32 max dimensions, with full res image aspect ratio as close as possible) |
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
#nullable disable | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.Diagnostics.CodeAnalysis; | |
namespace System.Collections.Generic | |
{ | |
/// <summary> | |
/// Dictionary that preserves inserted order of items during iteration. |
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; | |
using System.Collections.Generic; | |
using System.Threading; | |
using System.Threading.Tasks; | |
namespace Wfp | |
{ | |
/// PInvoke wrappers for Windows Filtering Platform | |
public class WfpNativeInterop | |
{ |
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; | |
using System.Collections.Generic; | |
using System.Text; | |
using System.Threading; | |
using System.Threading.Tasks; | |
namespace Polly.Utilities | |
{ | |
/// <summary> | |
/// Defines operations for locks used by Polly policies. |
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
/// <summary> | |
/// Simplified and improved IDistributedCache interface. No more stupid byte arrays. Removal events | |
/// can also be hooked into allowing removal from a local memory cache if desired. | |
/// </summary> | |
public interface IDistributedCache | |
{ | |
/// <summary> | |
/// Fires when an item is removed by another machine, parameters are the key and the machine name | |
/// </summary> | |
event Action<DistributedCacheRemoveEventArgs>? Removed; |
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
private static string[] GetStrings(string url) | |
{ | |
return new WebClient().DownloadString(url).Split('\n').Select(s => s.Trim()).ToArray(); | |
} | |
private static string[] GetCloudflareIP() | |
{ | |
try | |
{ | |
return GetStrings("https://www.cloudflare.com/ips-v4").Union(GetStrings("https://www.cloudflare.com/ips-v6")).ToArray(); |
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
// MIT license, https://github.com/jjxtra | |
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Reflection; | |
using System.Text; | |
using Microsoft.Extensions.FileProviders; |
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
Shader "Hidden/ComputeOcclusion" | |
{ | |
Properties | |
{ | |
_MainTex ("", 2D) = "white" {} | |
} | |
SubShader | |
{ | |
Pass | |
{ |
NewerOlder