View Using zstd for fast XFS dumps
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
# Dumps using zstd, with up to 32 threads. | |
# To silence zstd, add -q | |
# xfsdump -L mybackup -J - / | zstd -3 --threads=0 -o /backups/mybackup.zstd | |
xfsdump options (https://man.archlinux.org/man/xfsdump.8.en): | |
# -L session_label: Specifies a label for the dump session. It can be any arbitrary string up to 255 characters long. | |
# -J Inhibits the normal update of the inventory. This is useful when the media being dumped to will be discarded or overwritten. | |
# - sends output to stdout, for zstd to read | |
# / the partition directory |
View test
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
test |
View test_parser.py
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 json | |
import re | |
# Open the run_results.json, which contains results from the run or test run. | |
input_file = open('target/run_results.json') | |
json_array = json.load(input_file) | |
# If there is no errors, by default we just print a new line. | |
errors = "\n" | |
for item in json_array["results"]: | |
# Run and test have different syntaxes, this should cover them both. |
View gist:111870e15b83ce29761efc9ac1b5c69d
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
So you have setup your API to accept CORS requests on certain paths on your API using [cors_plug](https://github.com/mschae/cors_plug) or [corsica](https://github.com/whatyouhide/corsica) and you are wondering how you test this with ExUnit. | |
## Back to basics: Does the endpoint actually work? | |
Well the first thing to do is to check if your endpoint is actually working with CORS. | |
You can do this via cURL: | |
curl http://localhost:4000/api/posts -v -H "Origin: https://example.com" | |
View gist:721954bd410df4bb302c53667f0ea580
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
foreach (var item in items) | |
{ | |
var message = new Foobar(); | |
tasks.Add(context.Publish(message)); | |
} | |
await Task.WhenAll(tasks).ConfigureAwait(false); |
View app.js
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 { h, Component } from 'preact'; | |
import { Router } from 'preact-router'; | |
import Header from './header'; | |
import Home from '../routes/home'; | |
import Profile from '../routes/profile'; | |
import NotifyChange from "./NotifyChange/index"; | |
// import Home from 'async!../routes/home'; | |
// import Profile from 'async!../routes/profile'; |
View gist:a55e7dcb49838c0868227a2682a701ed
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
steps: | |
- checkout | |
- restore_cache: | |
keys: | |
- project-{{ checksum "mix.exs" }}-{{ checksum "mix.lock" }} | |
- run: | |
name: deps | |
command: MIX_ENV=test mix deps.get | |
- run: | |
name: compile test |
View gist:60348be4921994e6f494db89aa110a53
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
def create(conn, %{"grant_type" => "password", | |
"username" => username, | |
"password" => password}) do | |
try do | |
user = User | |
|> where(username: ^username) | |
|> where(active: true) | |
|> Repo.one! | |
cond do |
View controllers.application.js
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 Ember from 'ember'; | |
import AdultValidations from '../validations/adult'; | |
import ChildValidations from '../validations/child'; | |
import { reservedEmails } from '../validators/uniqueness'; | |
import { schema } from '../models/user'; | |
const { get } = Ember; | |
const { keys } = Object; | |
export default Ember.Controller.extend({ |
View gist:2babe6cf3ab8175661ad3374cbc62fb8
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
<html> | |
<style> | |
body { | |
background-color: #000; | |
} | |
h1 { | |
text-align: center; | |
color: #fff; | |
left: 0; | |
line-height: 200px; |
NewerOlder