Skip to content

Instantly share code, notes, and snippets.

View danielpetrica's full-sized avatar
🏠
Working from home

Daniel, Petrica Andrei-Daniel danielpetrica

🏠
Working from home
View GitHub Profile
@danielpetrica
danielpetrica / Readme.md
Last active May 14, 2022 18:03
A docker compose example file to use with laravel projects locally

A docker compose example file to use with laravel projects for development on local machines (tested with wsl2).

Before starting you should startup a docker network called local_docker from the cli. If you don't need to connect to external dockers you can remove the network configs altogheter.

Feel free to change the services name. PLease set the .env file before starting docker.

@simonghales
simonghales / revised.ts
Last active March 23, 2024 23:26
Running a game loop on a web worker
export const createNewPhysicsLoopWebWorker = (stepRate: number) => {
return new Worker('data:application/javascript,' +
encodeURIComponent(`
var start = performance.now();
var updateRate = ${stepRate};
function getNow() {
return start + performance.now();
}
@yehgdotnet
yehgdotnet / install_phpzip.md
Last active February 7, 2023 13:14
MAMP PRO for Mac OSX - Installing PHP ZIP extension

From Terminal

# install dependencies
brew install autoconf # required by pecl 
brew install libzip


# install zip extenion in your selected MAMP PHP version 
ls /Applications/MAMP/bin/php/
@rambabusaravanan
rambabusaravanan / apache.conf
Last active December 21, 2023 12:01
SPA - Apache, Nginx Configuration for Single Page Application like React.js on a custom path
# To host on root path just use "<Location />" for http://mydomainname.in
# To host on non-root path use "<Location /myreactapp>" for http://mydomainname.in/mypath
# If non-root path, don't forgot to add "homepage": "/myreactapp" in your app's package.json
<VirtualHost *:80>
ServerName mydomainname.in
DirectoryIndex index.html
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<?php
$color_gray = $_GET["color_gray"];
$color_dark= $_GET["color_dark"];
$color_green_dark = $_GET["color_green_dark"];
$color_green_light = $_GET["color_green_light"];
$color_green_ripple_active=$_GET["color_green_ripple_active"];
$textcolor=$_GET["textcolor"];
$msgInBg=$_GET["msgInBg"];
$msgOutBg=$_GET["msgOutBg"];
$msgFile1Bg=$_GET["msgFile1Bg"];
@Rich-Harris
Rich-Harris / service-workers.md
Last active May 6, 2024 22:10
Stuff I wish I'd known sooner about service workers

Stuff I wish I'd known sooner about service workers

I recently had several days of extremely frustrating experiences with service workers. Here are a few things I've since learned which would have made my life much easier but which isn't particularly obvious from most of the blog posts and videos I've seen.

I'll add to this list over time – suggested additions welcome in the comments or via twitter.com/rich_harris.

Use Canary for development instead of Chrome stable

Chrome 51 has some pretty wild behaviour related to console.log in service workers. Canary doesn't, and it has a load of really good service worker related stuff in devtools.

@alfredoem
alfredoem / pdf-example.blade.php
Created November 3, 2015 19:17
Template for a invoice render with DomPDF
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Aloha!</title>
<style type="text/css">
* {
font-family: Verdana, Arial, sans-serif;
}
@coolaj86
coolaj86 / github-pages-https-lets-encrypt.md
Last active November 16, 2021 22:36
Github Pages: Let's Encrypt!
string meaning
------ -------
@reboot Run once, at startup.
@yearly Run once a year, "0 0 1 1 *".
@annually (same as @yearly)
@monthly Run once a month, "0 0 1 * *".
@weekly Run once a week, "0 0 * * 0".
@daily Run once a day, "0 0 * * *".
@midnight (same as @daily)
@hourly Run once an hour, "0 * * * *".
function getXHR(url, callback) {
var xhr = new XMLHttpRequest(); // Creates a new XHR request
if (!url) {
throw new Error('No URL supplied');
}
xhr.open("GET", url, true); // Open the connection
xhr.setRequestHeader("Content-type",