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
#!/bin/bash | |
$USERNAME="Staging" | |
$USERLOGIN="staging" | |
sudo apt-get install emacs-nox | |
# Add DotNet tools: | |
# https://dotnet.microsoft.com/download/linux-package-manager/ubuntu18-04/sdk-current |
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.Linq; | |
using System.Security.Cryptography; | |
using System.Text; | |
namespace Common | |
{ | |
public static class GravatarHasher | |
{ | |
/// <summary> |
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 Microsoft.Data.Sqlite; | |
using Microsoft.EntityFrameworkCore; | |
// ... | |
public static MyDbContext InMemoryContext() | |
{ | |
// SEE: https://docs.microsoft.com/en-us/ef/core/miscellaneous/testing/sqlite | |
var connection = new SqliteConnection("Data Source=:memory:"); | |
var options = new DbContextOptionsBuilder<MyDbContext>() | |
.UseSqlite(connection) |
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
import * as React from "react"; | |
import * as ReactRedux from "react-redux"; | |
interface ICity { | |
cityName: string; | |
img: string; | |
} | |
// Action Creator | |
export const getCityInformation = () => ({ |
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
class MouseOverComponent extends React.Component { | |
componentDidMount() { | |
this.mouseMove$ = Rx.Observable.fromEvent(this.mouseDiv, "mousemove") | |
.throttleTime(1000) | |
.subscribe(() => console.log("throttled mouse move")); | |
} | |
componentWillUnmount() { | |
this.mouseMove$.unsubscribe(); |
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 Xunit; | |
// Tests for EventAggregator.cs (https://gist.github.com/mikebridge/f6799ebed20160f72a3daf62f584d2ff) | |
namespace Messaging.Tests.Unit | |
{ | |
public class EventAggregatorTests : IDisposable | |
{ |
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.Reactive.Linq; | |
using System.Reactive.Subjects; | |
// inspired by https://github.com/shiftkey/Reactive.EventAggregator/blob/master/src/Reactive.EventAggregator/EventAggregator.cs | |
namespace Messaging | |
{ | |
public interface IEventAggregator : IDisposable | |
{ |
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
// | |
// A TypeScript template for generating a Redux Test in IntelliJ. | |
// (accompanies https://gist.github.com/mikebridge/c75835cda361c5967de301995894bf30) | |
// | |
// Create: Settings -> Editor => Live Templates -> Add. | |
// - give it an abbreviation (e.g. "reduxtest") and a Description, and | |
// - Make it available in JavaScript "JSX HTML", JavaScript "Statement" and TypeScript | |
// | |
// Usage: create a file, e.g. "myTemplate.test.tsx", then type "Ctrl-J", and the abbreviation, e.g. "reduxtest". | |
// |
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
// | |
// A TypeScript template for generating a Redux Component in IntelliJ. | |
// | |
// Create: Settings -> Editor => Live Templates -> Add. | |
// - give it an abbreviation (e.g. "redux") and a Description, and | |
// - set FILENAME_PASCAL to capitalize(fileNameWithoutExtension()) in "Edit Variables" | |
// - Make it available in JavaScript "JSX HTML", JavaScript "Statement" and TypeScript | |
// | |
// Usage: create a file, e.g. "myTemplate.tsx", then type "Ctrl-J", and the abbreviation, e.g. "redux". | |
// |
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
import * as React from "react"; | |
import {shallow, mount} from "enzyme"; | |
import withQueryString from "./withQueryString"; | |
import {IQueryStringProps} from "./withQueryString"; | |
import {MemoryRouter} from "react-router"; | |
interface ITestComponentOwnProps {} | |
class TestComponent extends React.Component<IQueryStringProps & ITestComponentOwnProps, {}> { |