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 | |
// @version 1.0 | |
// @description Makes AWS automatically do a push on DUO | |
// @match https://domain/console/ | |
// @grant GM_addStyle | |
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js | |
// @require http://static-file-cdn.s3-website.us-east-2.amazonaws.com/js/waitForKeyElements.js | |
// ==/UserScript== | |
waitForKeyElements ("#wdc_mfa", actionFunction); |
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 Type GetCallingType() | |
{ | |
var stack = new StackTrace(); | |
var currentType = System.Reflection.MethodBase.GetCurrentMethod().DeclaringType; | |
var callingType = currentType; | |
var frames = stack.GetFrames() ?? new StackFrame[] { }; | |
foreach (var frame in frames) | |
{ | |
var method = frame.GetMethod(); |
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.Reflection; | |
using System.Reflection.Emit; | |
namespace TypeBuilderNamespace | |
{ | |
public static class MyTypeBuilder | |
{ | |
public static void CreateNewObject() | |
{ |
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 void InitializeDatabase(YourDbContext context) | |
{ | |
if (!context.Database.Exists() || !context.Database.CompatibleWithModel(false)) | |
{ | |
var configuration = new DbMigrationsConfiguration(); | |
var migrator = new DbMigrator(configuration); | |
migrator.Configuration.TargetDatabase = new DbConnectionInfo(context.Database.Connection.ConnectionString, "System.Data.SqlClient"); | |
var migrations = migrator.GetPendingMigrations(); | |
if (migrations.Any()) | |
{ |
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
openssl s_client -connect 13.226.49.64:443 -servername api-help.rendrneuro.com |
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
int[] parts = Decimal.GetBits(value); | |
bool sign = (parts[3] & 0x80000000) != 0; | |
byte scale = (byte) ((parts[3] >> 16) & 0x7F); | |
Decimal newValue = new Decimal(parts[0], parts[1], parts[2], sign, scale); |
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
iconv -f utf-16 -t utf-8 sqlerrors.log > sqlerrors-utf8.log |
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
// <configuration> | |
// <system.net> | |
// <webRequestModules> | |
// <add prefix="http" | |
// type="UserAgentRequestCreator, namespace, Version=1.0.0.0, | |
// Culture=neutral, PublicKeyToken=9999999999999999" | |
// /> | |
// </webRequestModules> | |
// </system.net> | |
// </configuration> |
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
Path.GetFullPath(new Uri(Path.Combine(Environment.CurrentDirectory, @"..\..\")).LocalPath); |
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
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" |