Skip to content

Instantly share code, notes, and snippets.

View MaxLazar's full-sized avatar
😇

Max Lazar MaxLazar

😇
View GitHub Profile
@MaxLazar
MaxLazar / MailHog.md
Created November 29, 2018 03:05
MailHog install

Install MailHog with MAMP Pro, using HomeBrew.

MailHog

First let's make sure HB is updated. Open up terminal for the following steps.

$ brew update
#!env bash
# Nginx-Craft virtual host configuration file
# @author MaxLazar
# @copyright Copyright (c) 2018
# @link https://maxlazar.com/
# @package server-install-lemp
# @since 1.0.0
# @license MIT
# sudo sh install_server.sh
# https://linuxize.com/post/how-to-add-swap-space-on-centos-7/
/*
// Check TLS version
//
*/
<?php
function get_tls_version($sslversion = null)
{
$c = curl_init();
curl_setopt($c, CURLOPT_URL, "https://www.howsmyssl.com/a/check");
curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
curl -w "@curl-format.txt" -o /dev/null -s http://wordpress.com/
n
time_namelookup: %{time_namelookup}n
time_connect: %{time_connect}n
time_appconnect: %{time_appconnect}n
time_pretransfer: %{time_pretransfer}n
time_redirect: %{time_redirect}n
time_starttransfer: %{time_starttransfer}n
----------n
@MaxLazar
MaxLazar / hipchat-v2.sh
Created November 29, 2017 10:37 — forked from danriti/hipchat-v2.sh
HipChat API v2 - Send a message to a room using cURL
#!/bin/bash
# Set the ROOM_ID & AUTH_TOKEN variables below.
# Further instructions at https://www.hipchat.com/docs/apiv2/auth
ROOM_ID=XXX
AUTH_TOKEN=XXX
MESSAGE="Hello world!"
curl -H "Content-Type: application/json" \
cd /etc/ssl/certs
openssl dhparam -out dhparam.pem 4096
Cookies
All cookies should be created such that their access is as limited as possible. This can help minimize damage from cross-site scripting (XSS) vulnerabilities, as these cookies often contain session identifiers or other sensitive information.
Directives
Secure: All cookies must be set with the Secure flag, indicating that they should only be sent over HTTPS
HttpOnly: Cookies that don't require access from JavaScript should be set with the HttpOnly flag
Expiration: Cookies should expire as soon as is necessary: session identifiers in particular should expire quickly
Adyen Test Card Numbers
These cards are only valid on our TEST system and they will never involve any actual transaction or transfer of funds. The TEST card numbers will not work on the Adyen LIVE Platform.
For all cards use the following expiration and CVV2/CVC2/or CID for Amex.
For all cards:
Expiration Dates CVV2 / CVC3 CID (American Express)
06/2016 OR 08/2018 737 7373
@MaxLazar
MaxLazar / robots.txt nginx
Last active March 25, 2024 07:55
Serve robots.txt inline in Nginx
Serve robots.txt inline in Nginx
06/18/2015 nginx 3 Comments
To quickly serve a robots.txt from Nginx without actually having access to the physical file you can define the content of the robots.txt file in the Nginx .conf file.
Allow access to all User-agents:
location /robots.txt {return 200 "User-agent: *\nDisallow:\n";}
Disallow access to every User-agent:
@MaxLazar
MaxLazar / gist:0193eabf5d3749ed04a05e8f1bb6f1d8
Created August 11, 2016 14:07
Cheat Sheet: craft.entries
{# craft.entries tag #}
{% set entries = craft.entries.first() %}
{% set entries = craft.entries.last() %}
{% set entries = craft.entries.find() %}
{% set entries = craft.entries.ids() %}
{% set entries = craft.entries.total() %}
{% set entries = craft.entries({
id: id OR 'not id' OR '1,2,3' OR [1,2,3],
fixedOrder: true OR false,
How tasks works
http://craftcms.stackexchange.com/questions/14530/tasks-and-steps