Skip to content

Instantly share code, notes, and snippets.

Avatar

Alfred Myers alfredmyers

View GitHub Profile
@alfredmyers
alfredmyers / gist:5cc3b9e4aa97bf9d20da
Last active August 29, 2015 14:24
Google for Work Security Key Challenge
View gist:5cc3b9e4aa97bf9d20da
<html>
<head>
<script type='text/javascript'>
function decypher() {
var om = document.getElementById('orig_message').value;
var msg = '';
var cypher = -3;
for (i = 0; i < om.length; i++) {
var ascii = om.charCodeAt(i);
@alfredmyers
alfredmyers / factorial.js
Last active August 29, 2015 14:25
Factorial with memoization
View factorial.js
var factorial = (function () {
var cache = [1];
return function factorial(n) {
if(n < 0) {
return Infinity;
}
n = parseInt(n);
if (n < cache.length) {
return cache[n];
View 10.1 Defining Regular Expressions.html
<html>
<head>
</head>
<body>
The JavaScript language
JavaScript
JavaScript
<script type="text/javascript">
"use strict";
var p = /s$/;
View 2015-08-03a.js
// JavaScript aceita divisão por 0:
1 / 0 == Infinite
0 / 0 == NaN
// e o mais curioso:
NaN != NaN
@alfredmyers
alfredmyers / TestWindowPackage
Created October 14, 2015 22:21
TestWindowPackage error message
View TestWindowPackage
---------------------------
Microsoft Visual Studio
---------------------------
The 'TestWindowPackage' package did not load correctly.
The problem may have been caused by a configuration change or by the installation of another extension. You can get more information by examining the file 'C:\Users\alfred.myers\AppData\Roaming\Microsoft\VisualStudio\14.0\ActivityLog.xml'.
View ConditionalCompilationSymbolsForMscorlib.txt
_USE_NLS_PLUS_TABLE
ARRAY_GENERIC_METHODS
CODE_ANALYSIS_BASELINE
ETW_SUPPORTED
FEATURE_APPDOMAIN_RESOURCE_MONITORING
FEATURE_APPDOMAINMANAGER_INITOPTIONS
FEATURE_APPX
FEATURE_APPX_BINDER
FEATURE_APTCA
FEATURE_ASCII
@alfredmyers
alfredmyers / DeviceOsTargetPlatformAfter.cs
Created November 23, 2017 12:51
Xamarin.Forms.Device.OS and Xamarin.Forms.TargetPlatform deprecated
View DeviceOsTargetPlatformAfter.cs
if (Device.RuntimePlatform == Device.Android)
{
//platform specific code
}
else if (Device.RuntimePlatform == Device.iOS)
{
//platform specific code
}
@alfredmyers
alfredmyers / BulkNuGetInstall.ps1
Created January 17, 2018 15:54 — forked from aaronpowell/BulkNuGetInstall.ps1
Install NuGet across all projects
View BulkNuGetInstall.ps1
#Installs a package into all projects in the solution (note: Requires NuGet 1.1+)
Get-Project -All | Install-Package packageName
@alfredmyers
alfredmyers / gist:4b93a27af706a3a1a70ce2bcbe3b9456
Created January 17, 2018 17:01
msbuild RoslynAnalyzers.sln
View gist:4b93a27af706a3a1a70ce2bcbe3b9456
This file has been truncated, but you can view the full file.
Microsoft (R) Build Engine version 15.5.180.51428 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
Build started 1/17/2018 14:49:15.
Project "C:\Code\GitHub\dotnet\roslyn-analyzers\RoslynAnalyzers.sln" on node 1 (default targets).
ValidateSolutionConfiguration:
Building solution configuration "Debug|Any CPU".
Project "C:\Code\GitHub\dotnet\roslyn-analyzers\RoslynAnalyzers.sln" (1) is building "C:\Code\GitHub\dotnet\roslyn-analyzers\src\Roslyn.Diagnostics.Analyzers\Core\Roslyn.Diagnostics.Analyzers.csproj" (2) on node 1 (default targets).
CoreResGen:
View HtmlFromHtmlAfter.cs
private ISpanned FromHtml(string source)
{
// app specific code
if (Build.VERSION.SdkInt >= BuildVersionCodes.N)
{
return Html.FromHtml(source, FromHtmlOptions.ModeLegacy);
}
#pragma warning disable CS0618 // Type or member is obsolete