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
--- | |
- name: Setup Vaultwarden | |
hosts: target | |
become: yes | |
become_user: root | |
tasks: | |
- include: ../tasks/base.yml | |
- name: Install libs | |
dnf: |
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
/* | |
This is a simple function I wrote to make awaiting promises with timeouts easier. | |
Pass it in a timeout length and a promise, and you can attach handlers for when | |
the promise resolves on time, when it resolves late, and when the timeout expires. | |
Here's a snippet from one of my projects as an example: | |
withTimeout(request_timeout, this.kernel.handle(req)) | |
.on_time(output_req => { // called if it resolves on time |
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
from mpi4py import MPI | |
from math import pi as PI | |
from numpy import array | |
def comp_pi(n, myrank=0, nprocs=1): | |
h = 1.0 / n | |
s = 0.0 | |
for i in range(myrank + 1, n + 1, nprocs): | |
x = h * (i - 0.5) | |
s += 4.0 / (1.0 + x**2) |
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 | |
VERSION="1.3" | |
AUTHOR="Garrett Mills" | |
NODECOUNT=1 | |
NTASKS=1 | |
PARTITION=sixhour | |
SHELL=bash | |
JOBNAME="getnode" |
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
const newton = (x0, fn, derivative) => { | |
const estimates = [x0] | |
let next, last | |
while ( estimates.slice(-1).pop() > 0.09 ){ | |
last = estimates.slice(-1)[0] | |
next = last - (fn(last)/derivative(last)) |
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
const newton = (x0, fn, derivative, precision=3, array=false) => { | |
const estimates = [x0] | |
let next, last, variation = 1 | |
while ( variation > (Math.pow(10, (-1 * precision))) ){ | |
last = estimates.slice(-1)[0] | |
next = last - (fn(last)/derivative(last)) | |
estimates.push(next) |
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
<?php | |
/** | |
* Searches the collection of given $models for | |
* $string and returns the results. | |
* | |
* @param \Illuminate\Support\Collection $models | |
* @param $string | |
* @param $fields | |
* @return \Illuminate\Support\Collection |
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/sh | |
# onedrive-ubu.sh | |
# A BASH script to set up OneDrive integration with GNOME on Ubuntu | |
# Copyright (C) 2018 Garrett Mills ([email protected]) | |
# This software is licensed under the MIT License. | |
# This sofware is provided without warranty or even any implied intent of purpose. | |
# | |
# OnedriveD: https://github.com/xybu/onedrived-dev |
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
Tidbit Laravel plugin |
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
GNU GENERAL PUBLIC LICENSE | |
Version 3, 29 June 2007 | |
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> | |
Everyone is permitted to copy and distribute verbatim copies | |
of this license document, but changing it is not allowed. | |
Preamble | |
The GNU General Public License is a free, copyleft license for |
NewerOlder