Skip to content

Instantly share code, notes, and snippets.

@laacz
laacz / Ezernieku pagasts.geojson
Last active April 11, 2019 07:12
Ezernieku pagasts
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@laacz
laacz / lights.html
Created February 4, 2019 23:22
Slēdzis un pārslēdzis
<!DOCTYPE html>
<html lang="lv">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
section {
@laacz
laacz / rpn.php
Created January 28, 2019 22:34
RPN
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>RPN</title>
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.2/css/bulma.css">
</head>
@laacz
laacz / main.cpp
Last active January 9, 2019 09:31
Remote (ESP8266) and physical switching of lights, state saving, etc.
/**
* This tiny ESP8266 sketch starts a web server,
* shows a button, allows to toggle one relay,
* saves its state to EEPROM, resotres upon reboot.
* Tries to connect to MQTT server to report on relay
* state changes via two topics.
*
* Sketch is used to play with simple multiway switches
* and ESP8266 + SPDT relay to be able to toggle lights
* from any of physical switches and also remotely.
@laacz
laacz / binarlauks.html
Created January 31, 2018 08:48
HTML koda sagatave, kura pasargā visus no binārlauka negatīvās enerģijas nelabvēlīgās ietekmes.
<!doctype html>
<head>
<!--
Šis pasargā no binārlauka negatīvās enerģijas nelabvēlīgās ietekmes.
Sīkāk: https://www.facebook.com/CUBESystems/videos/vb.158748300855954/1694637707266998/?type=2&theater
&
@@@@
@@@@
% @@@@
@laacz
laacz / default.conf
Last active December 13, 2017 20:28
nginx config for automatic vhosts (with laravel recognition)
server {
listen 80 default_server;
error_log /var/log/nginx/error.log;
index index.html index.htm index.nginx-debian.html index.php;
server_name ~^(?<vhost>[^.]*).localhost$;
# Let's see, if we have Laravel's /public
@laacz
laacz / wp-update.sh
Last active December 13, 2017 14:45
Find ordpresses and update them (plugins too)
#!/usr/bin/env bash
#
# Script will find all wordpress installs and check if they're out of date
#
# Using wp-cli - http://wp-cli.org/
# Paths to search for wordpresses. Separated by space.
PATHS="/var/www /data/www"
# Paths to ignore (should not be checked). Separated by space.
@laacz
laacz / php-fpm-apache-on-wsl.md
Last active July 27, 2023 15:48
PHP 7.x (FPM), Apache2 on WSL

PHP-FPM, Apache with *.localhost virtualhosts on WSL

This will help installing simple PHP stack with *.localhost domains on Windows Subsystem for Linux in Windows 10. You'll have to add sudo where appropriate.

PHP 7.x (FPM)

You'll need to add an unofficial repository by awesome Ondřej Surý, but it's been stable for years and can be used in production.

sudo apt-get install -y python-software-properties
@laacz
laacz / lks92.php
Created April 18, 2016 11:42
LKS92 uz WGS84 un otrādāk Raw
<?php
const LKS_UTM_SCALE_FACTOR = 0.9996;
function lks_ArcLengthOfMeridian($phi) {
/* Precalculate n */
$sm_a = 6378137.0;
$sm_b = 6356752.314140;
$n = ($sm_a - $sm_b) / ($sm_a + $sm_b);
/* Precalculate alpha */
$alpha = (($sm_a + $sm_b) / 2.0)
* (1.0 + (pow ($n, 2.0) / 4.0) + (pow ($n, 4.0) / 64.0));
@laacz
laacz / namedays-extended.json
Last active January 10, 2024 06:44
Vārdadienas JSON (par prieku Sergejam)
{
"01-01": ["Afra", "Afrodīte", "Agunda", "Agurs", "Januārija", "Laimstars", "Soleda", "Solita", "Solveta"],
"01-02": ["Induls", "Īva", "Ivaise", "Ivija", "Īvija", "Ivika", "Īvis", "Ivisa", "Ivs"],
"01-03": ["Ambrozijs", "Ammonārija", "Ammunārija", "Mežvaldis", "Mieriņš", "Miermīlis", "Miernesis", "Miervalds", "Ringla", "Ringo", "Rinolds"],
"01-04": ["Amina", "Amīna", "Amirans", "Amirs", "Blāzma", "Ilveta", "Ilvis", "Spodrīte"],
"01-05": ["Amrita", "Amunds", "Anarita", "Saimona", "Saimons", "Seimanis", "Semions", "Semjons", "Simeons", "Simions", "Zintauts", "Zinturs"],
"01-06": ["Arams", "Aranta", "Arfa", "Arnīda", "Arnija", "Arnika"],
"01-07": ["Julians", "Jūlians", "Jūliāns", "Sigmars", "Sigmārs", "Zigmāra", "Zigmāris", "Zigmars"],
"01-08": ["Ants", "Aristarhs", "Aristida", "Aristīda", "Aristids", "Aristīds", "Aristons", "Aristrīds", "Arjana", "Arlands", "Arleta", "Arlēna", "Arlijs", "Arlita", "Gatiņš", "Īvande", "Ivanna", "Ivase", "Ivena"],
"01-09": ["Aksela", "Akselis",