Skip to content

Instantly share code, notes, and snippets.

View Ravaelles's full-sized avatar
🏠
Working remotely

Ravaelles

🏠
Working remotely
  • Fullstack Laravel developer
  • Poland
View GitHub Profile
@Ravaelles
Ravaelles / Laravel Homestead + MongoDB PHP 7.1 driver
Last active July 4, 2018 13:51
Laravel Homestead + MongoDB PHP 7.1 driver installer
#!/bin/bash
######################################################
### README ###########################################
######################################################
###
### One-line Laravel Homestead MongoDB driver PHP installer.
###
### What it does:
### - installs some MongoDB PHP driver dependencies
@Ravaelles
Ravaelles / Ubuntu server setup script (PHP 5.6)
Last active April 6, 2020 12:13
PHP 5.6 + nginx + MongoDB driver for PHP
#!/bin/bash
######################################################
### README ###########################################
######################################################
###
### One-line server install script for Ubuntu.
### Installs Nginx + PHP5.6 + MongoDB for PHP driver.
###
### Removes previous Apache, PHP, nginx installations.
private static Unit getMineralFieldToGather(Unit worker) {
// Get nearest base for this unit
Unit base = Select.ourBases().nearestTo(worker.getPosition());
if (base == null) {
return null;
}
// Get minerals near to our main base and sort them from closest to most distant one
List<Unit> minerals = (List<Unit>) Select.minerals().inRadius(12, base.getPosition()).listUnits();
server {
listen 80 default_server;
listen [::]:80 default_server;
# Default route for Laravel projects
root /var/www/html/public;
# Add index.php to the list if you are using PHP
index index.html index.htm index.php;
@Ravaelles
Ravaelles / pleaseWait.js
Last active September 27, 2022 05:54
Very easy javascript code to display page "Please wait" using bootstrap modal with nice progress bar.
/**
* Displays overlay with "Please wait" text. Based on bootstrap modal. Contains animated progress bar.
*/
function showPleaseWait() {
if (document.querySelector("#pleaseWaitDialog") == null) {
var modalLoading = '<div class="modal" id="pleaseWaitDialog" data-backdrop="static" data-keyboard="false" role="dialog">\
<div class="modal-dialog">\
<div class="modal-content">\
<div class="modal-header">\
<h4 class="modal-title">Please wait...</h4>\