Skip to content

Instantly share code, notes, and snippets.

View mungurs's full-sized avatar

Mārtiņš Ungurs mungurs

  • Latvia
View GitHub Profile
@mungurs
mungurs / EloquentCheatSheet.md
Created April 15, 2022 15:19 — forked from avataru/EloquentCheatSheet.md
Eloquent relationships cheat sheet
@mungurs
mungurs / instructions.md
Created October 2, 2020 21:18 — forked from andrewn/instructions.md
Testing SSL (LetsEncrypt certificate and loopback domain)

Testing SSL (LetsEncrypt certificate and loopback domain)

General approach

This sets up a publically-available domain that loops back to localhost IP address 127.0.0.1. For example, this address could be localhost.example.com if we controlled the example.com domain. This relies on having a public domain name whose DNS records you can control. We can then generate LetsEncrypt certificates for this domain.

Our HTTP server runs on localhost:80 (default HTTP port). This lets us visit http://localhost.example.com in a web browser and see the server running on localhost:80.

We then run an HTTPS proxy server on localhost:443 (default HTTPS port) that uses the LetsEncrypt certificates we generated for localhost.example.com. Visiting https://localhost.example.com hits the proxy, which returns the correct certificates meaning the browser displays the "Secure" message. The proxy then passes the request through to the HTTP server.

@mungurs
mungurs / ex.js
Created October 9, 2018 06:56 — forked from ritch/ex.js
What is the best way to document complex / dynamic objects as arguments to a function?
/**
* Below are several examples of methods that are difficult to clearly annotate with JSDoc annotations.
*/
/**
* @param {Object} people An index of people keyed by a person's name
* @returns {Object} map An index of zipcodes keyed by a person's name
*/
function find(people) {
@mungurs
mungurs / binarlauks.html
Created January 31, 2018 09:06 — forked from laacz/binarlauks.html
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
&
@@@@
@@@@
% @@@@
@mungurs
mungurs / SassMeister-input.scss
Last active October 13, 2017 07:25
Generated by SassMeister.com.
// ----
// Sass (v3.4.21)
// Compass (v1.0.3)
// ----
// ----
// Sass (v3.4.21)
// Compass (v1.0.3)
// ----
@mungurs
mungurs / xdebug.md
Created July 7, 2017 06:53 — forked from ankurk91/xdebug-mac.md
php xDebug on Ubuntu and phpStorm 2016

🪲 Install and Configure xDebug on Ubuntu and Php Storm 🐘

  • Assuming that you have already installed php and apache
  • Install xDebug php extension
# Ubuntu 16.04, php 7.0
sudo apt-get install php-xdebug

# Ubuntu 14.04, php 5.6 
sudo apt-get install php5-xdebug
@mungurs
mungurs / google_calendar.css
Created July 3, 2017 11:30 — forked from dawoodman71/google_calendar.css
PHP Solution for adding a Google Calendar, injecting styles and changing options dynamically.
.dp-cur, .chip dt, .te, .te-t, .te-rev-s, .rb-n, .rb-i, .agenda, .event-title{
white-space:normal !important;
}
#calendarTitle,
.tab-name,
img[title="Print my calendar (shows preview)"],
.footer img,
.details .links a:last-child,
.event-links a:last-child
@mungurs
mungurs / wp-admin bar CSS fix
Created May 10, 2017 14:50 — forked from KnightAlex/wp-admin bar CSS fix
CSS fix for wp-admin bar, for when body has relative positioning
@media (max-width: 600px) {
html #wpadminbar{top:-46px} /* wp admin bar fix, due to slide-push menu putting a relative position on the body element */
}
<?
class leafFile extends leafBaseObject
{
const tableName = 'leafFiles';
const defaultFolderMode = 0775; // rwx rwx r-x
const defaultFileMode = 0666; // rw- rw- rw-
const inputFieldSuffix = '_hash';
<?php
class fileManagerFacade {
private $fileSync = null;
private $elFinder = null;
private $connector = null;
private $rootDirName = 'files-manager';
private $visibleFileTypes = [];