These rules are adopted from the AngularJS commit conventions.
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
Latency Comparison Numbers (~2012) | |
---------------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
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
# Optimized my.cnf configuration for MySQL/MariaSQL on cPanel/WHM servers | |
# | |
# by Fotis Evangelou, developer of Engintron (engintron.com) | |
# | |
# === Updated December 2018 === | |
# | |
# The settings provided below are a starting point for a 2GB - 4GB RAM server with 2-4 CPU cores. | |
# If you have less or more resources available you should adjust accordingly to save CPU, | |
# RAM and disk I/O usage. | |
# The settings marked with a specific comment or the word "UPD" after the value |
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
#!/usr/bin/perl | |
# | |
# mysqldump -routines --no-create-info --no-data --no-create-db --compact | perl $0 | |
use strict; | |
use warnings; | |
use utf8; | |
my $output_dir = "out"; |
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 | |
# Simple inspector for Docker container IP address | |
# https://gist.github.com/mugifly/3bb1c54b48764340eda8 | |
print_help () { | |
echo -e "USAGE: docker-container-ip.sh KEYWORD\n" | |
echo "KEYWORD: A keyword string for target container." | |
echo " e.g. dokku.mysql.foobar" | |
echo -e "\n[Example usecases]" | |
echo " Connect to MySQL database in container:" |
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 -eu | |
# | |
# This script can sync MySQL schema without `DROP TABLE`. | |
# And If table isn't exists, import tables from source. | |
# | |
# Finally there is a confirmation screen. | |
# | |
# Need these packages: mysql, mysqldump, mysqldiff | |
# GitHub: @rluisr |
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; | |
namespace StackExchange.Redis | |
{ | |
static class RedisKeyspaceNotifications | |
{ | |
/// <summary> | |
/// NOTE: For this sample to work, you need to go to the Azure Portal and configure keyspace notifications with "Kxge$" to | |
/// 1) turn on expiration notifications (x), | |
/// 2) general command notices (g) and |
You can download whole courses from an array of tutorial sites with the CLI tool youtube-dl
. In the example further down I'm using my Pluralsight account to get videos from a course at their site. Here is a list of all supported sites that you can download from with this tool
The flags you have to supply may vary depending on which site you make a request to.
You can get a free 3 month trial to Pluralsight by signing up for free to Visual Studio Dev Essentials
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
1. Install Docker CE and enable Kubernetes: | |
See Figure 1 and 2 in https://medium.com/slalom-technology/get-kubernetes-running-locally-on-osx-and-windows-b3b5f176b5bb | |
2. (Optionally) Install k8s dashboard: | |
``` | |
$ kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard.yaml | |
$ kubectl proxy | |
``` |
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
type MethodDecorator = (target: any, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor) => | |
TypedPropertyDescriptor | void; | |
type AssertFn = (...args: Array<any>) => void; | |
class TSContract { | |
private static isCustomContractInterruptionCb: boolean = false; | |
private static contractInterruptionCb(message: string): void { | |
console.warn(message); |
NewerOlder