- Diagnose the problem
- Look for solution
- Look for tools
- Note your solutions by using pseudo code
# SETUP # | |
DOMAIN=example.com | |
PROJECT_REPO="git@github.com:example.com/app.git" | |
AMOUNT_KEEP_RELEASES=5 | |
RELEASE_NAME=$(date +%s--%Y_%m_%d--%H_%M_%S) | |
RELEASES_DIRECTORY=~/$DOMAIN/releases | |
DEPLOYMENT_DIRECTORY=$RELEASES_DIRECTORY/$RELEASE_NAME | |
# stop script on error signal (-e) and undefined variables (-u) |
class MyService { | |
final _log = Logger('MyService'); | |
void init() { | |
try { | |
// operation | |
_log("initialized"); | |
} catch(e, stackTrace){ | |
_log.e("init() error", e, stackTrace); | |
} |
import 'dart:math'; | |
import 'package:flutter/material.dart'; | |
import 'package:flutter_test/flutter_test.dart'; | |
extension TestingHelpers on WidgetTester { | |
/// Helper method for tapping a finder, and for optionally choosing the index | |
/// if the finder finds multiple and if we should scroll to before tapping. | |
Future<void> tapFinder( | |
Finder finder, { |
extension on WidgetTester { | |
Future<void> launchApp() async { | |
await app.main(); | |
await pumpAndSettle(); | |
} | |
Future<void> clearState() async { | |
await SharedPreferences.getInstance().then((it) => it.clear()); | |
} |
{ | |
"terminal.integrated.profiles.windows": { | |
"PowerShell": { | |
"source": "PowerShell", | |
"icon": "terminal-powershell" | |
}, | |
"Command Prompt": { | |
"path": [ | |
"${env:windir}\\Sysnative\\cmd.exe", | |
"${env:windir}\\System32\\cmd.exe" |
# RydMike LINTER Preferences v2.2.0 | |
# | |
# Get this file here: https://gist.github.com/rydmike/fdb53ddd933c37d20e6f3188a936cd4c | |
# | |
# We include and activate all lint rules, later below we disable the not used or desired ones. | |
# You can find a list of all lint rules to put in your all_lint_rules.yaml file here: | |
# https://dart.dev/tools/linter-rules/all | |
# | |
# For a comparison of all lint rules settings in rule styles listed below, please see this Google | |
# sheet: https://docs.google.com/spreadsheets/d/1Nc1gFjmCOMubWZD7f2E4fLhWN7LYaOE__tsA7bf2NjA |
#!/bin/bash | |
echo "App Release Automator by @rodydavis" | |
action="$1" | |
red=`tput setaf 1` | |
green=`tput setaf 2` | |
reset=`tput sgr0` | |
if [ ${action} = "build" ]; then |
In some cases for Python unit tests, we want to automatically perform setUp
methods in as declared in a base class. However, we still want setUp
to work as per normal in the subclass. The following code will proxy the new setUp
function to run it's base class' and the new one.
# Define a common test base for starting servers
class MyBaseTestCase(unittest.TestCase):
@classmethod
def setUpClass(cls):
"""On inherited classes, run our `setUp` method"""
# Inspired via http://stackoverflow.com/questions/1323455/python-unit-test-with-base-and-sub-class/17696807#17696807
if cls is not MyBaseTestCase and cls.setUp is not MyBaseTestCase.setUp:
# Author: Pieter Noordhuis | |
# Description: Simple demo to showcase Redis PubSub with EventMachine | |
# | |
# Update 7 Oct 2010: | |
# - This example does *not* appear to work with Chrome >=6.0. Apparently, | |
# the WebSocket protocol implementation in the cramp gem does not work | |
# well with Chrome's (newer) WebSocket implementation. | |
# | |
# Requirements: | |
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby |