Skip to content

Instantly share code, notes, and snippets.

@NickCraver
NickCraver / .editorconfig
Created September 26, 2017 21:31
Stack Overflow's .editorconfig
# editorconfig.org
root = true
# Don't use tabs for indentation.
[*]
indent_style = space
[*.less]
charset = utf-8
end_of_line = lf
@christophermark
christophermark / Doze_Mode_Behavior.md
Last active August 20, 2021 21:37
Android Marshmallow Idle Mode Behavior

What is "idle mode"?

Idle mode is a state where the phone has no network connectivity and apps are temporarily suspended. Idle mode gets triggered by one of two ways: an asleep, still, unplugged phone (Doze mode), and when an app has not been opened in a significant amount of time (App Standby Mode). During idle mode via Doze, the phone will wake up periodically for a short amount of time, allowing apps to run and use network connectivity. Using several different methods outlined below, it is possible to wake apps up during idle mode outside of these maintenance windows.

Time to enter Doze mode

1 hour of being still after the screen turns off.

Time to enter App Standby mode

TBD

Idle maintenance windows

@bradphelan
bradphelan / reactiveui-regions.cs
Created June 26, 2013 14:11
ReactiveUI Region control and attached behaviours
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
@mfcollins3
mfcollins3 / GenerateVersionInfo.xml
Created January 24, 2013 16:44
Classes for using semantic version numbers with .NET applications. For more information, see <http://www.michaelfcollins3.me/blog/2013/01/23/semantic_versioning_dotnet.html>.
<!--
The GenerateVersionInfo task will generate the VersionInfo.cs file with the
metadata for the current build.
-->
<UsingTask TaskName="GenerateVersionInfo"
TaskFactory="CodeTaskFactory"
AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
<ParameterGroup>
static readonly string[] videoCardBlacklist = {"8086:0116"};
static void DisableHwRenderingForCrapVideoCards()
{
if (!String.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable("MY_VIDEO_CARD_REALLY_WORKS")))
{
return;
}
int osVersion = Environment.OSVersion.Version.Major * 100 + Environment.OSVersion.Version.Minor;
if (osVersion < 601)