Skip to content

Instantly share code, notes, and snippets.

View rodde177's full-sized avatar

rodde177

  • sthlm
View GitHub Profile
@goivvy
goivvy / etc-nginx-sites-enabled-default
Last active March 1, 2017 08:17
Nginx for Magento 2.1.3
server {
listen 80 default_server;
listen [::]:80 default_server;
set $MAGE_ROOT /var/www/html;
index index.html index.htm index.nginx-debian.html;
server_name _;

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

<?php
trait Memoize
{
/**
* @var array [method][parameters]
*/
private $memoizedResults = [];
protected function memoizedCall($methodName, $args)
{
@TheFrankman
TheFrankman / Release.php
Last active August 16, 2017 17:22
Programatically Create Order
<?php
/**
* @author Frank Clark
*/
namespace Vendor\Namspace\Model\Subscription\Order;
use Vendor\Namspace\Model\ResourceModel\Subscriptions\CollectionFactory;
use Vendor\Namspace\Api\SubscriptionsOrdersRepositoryInterface;
use Vendor\Namspace\Model\SubscriptionsOrdersFactory;
use Vendor\Namspace\Model\Subscriptions;
@dfelton
dfelton / 000 - Magento Installer Script Quick Reference Guide.md
Last active September 16, 2019 19:51
Magento - Quick Reference Guide for creating new attributes via an installer script for EAV and flat table entity types.
@scottsb
scottsb / casesafe.sh
Last active January 16, 2024 08:47 — forked from Hais/workspace.sh
Create and manage a case-sensitive disk-image on macOS (OS X).
#!/bin/bash
# ---------------------------------------------------------
# Customizable Settings
# ---------------------------------------------------------
MOUNT_POINT="${CASE_SAFE_MOUNT_POINT:-${HOME}/casesafe}"
VOLUME_PATH="${CASE_SAFE_VOLUME_PATH:-${HOME}/.casesafe.dmg.sparseimage}"
VOLUME_NAME="${CASE_SAFE_VOLUME_NAME:-casesafe}"
VOLUME_SIZE="${CASE_SAFE_VOLUME_SIZE:-60g}"
@santanub
santanub / elasticsearch.text
Last active May 18, 2016 11:55
ElasticSearch
Installing elasticsearch
1. Visit https://www.elastic.co/downloads
2. Download zip version. Unzip it.
3. Run bin/elasticsearch
4. Visit http://localhost:9200/. If it return status 200, it is succesfully installed.
Elasticsearch uses JavaScript Object Notation, or JSON, as the serialization format for documents. JSON serialization is
supported by most programming languages, and has become the standard format used by the NoSQL movement. It is simple,
concise, and easy to read.
@harlesc
harlesc / Dockerfile
Last active March 14, 2017 13:03
Docker + PHP 7.0.0RC6 + xdebug + docker-spy for Magento 1.9 development
# Charles Hilditch <info@magemechanic.com>
# Tested on Magento 1.9.2.2 with MageMechanic_PhpSeven module installed for PHP7 compatibility.
# https://github.com/MageMechanic/PhpSeven
FROM php:7-apache
RUN apt-get update && apt-get install -y vim libfreetype6-dev libjpeg62-turbo-dev libmcrypt-dev libpng12-dev libicu-dev mlocate
RUN chown -R www-data:www-data /var/www/html
RUN docker-php-ext-configure gd --with-jpeg-dir=/usr/lib/x86_64-linux-gnu
RUN docker-php-ext-install gd mysqli pdo pdo_mysql mcrypt intl
RUN cp /usr/src/php/php.ini-development /usr/local/etc/php/php.ini && sed -i.bak 's/\;error_log = php_errors.log/error_log = \/var\/log\/php_errors.log/' /usr/local/etc/php/php.ini && touch /var/log/php_errors.log
RUN a2enmod rewrite && apachectl restart
@raybogman
raybogman / SupportDesk_FixAcl.php
Last active July 6, 2018 19:00
SupportDesk_FixAcl
<?php
/**
* SupportDesk_FixAcl.php v1.1
* SupportDesk (www.supportdesk.nu)
* 10/7/2015
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* It is available through the world-wide-web at this URL:
@ju2wheels
ju2wheels / docker-compose.yml
Created June 10, 2015 20:11
docker-compose reference YAML file with comments
# https://docs.docker.com/compose/yml/
# Each service defined in docker-compose.yml must specify exactly one of
# image or build. Other keys are optional, and are analogous to their
# docker run command-line counterparts.
#
# As with docker run, options specified in the Dockerfile (e.g., CMD,
# EXPOSE, VOLUME, ENV) are respected by default - you don't need to
# specify them again in docker-compose.yml.
#
service_name: