Skip to content

Instantly share code, notes, and snippets.

View EOM's full-sized avatar

Sergio N. EOM

View GitHub Profile
@EOM
EOM / CustomPaginationForJOIN-in-CakePHP
Last active August 29, 2015 14:21
Personalizar los datos del paginador de CakePHP con la union de datos por medio de JOINS muy simple de implementar
<?php
/**
* Application level Controller
*/
App::uses('Controller', 'Controller');
// Controller Ejemplo
class AppController extends Controller {
public function index(){
@punkdata
punkdata / cloud-config.yaml
Last active August 8, 2018 06:21
CoreOS cloud-config.yaml Example
#cloud-config
hostname: <your hostname>
ssh_authorized_keys:
- ssh-rsa < your Public SSH key AAAAB3NzaC1... >
coreos:
etcd:
addr: $private_ipv4:4001
@jult
jult / install_ispcfg_for_deb9.sh
Last active August 14, 2018 14:51 — forked from jniltinho/install_ispconfig_nginx_debian.sh
ISPconfig 3.x install with NGINX 1.13.x + PHP 7.1 on Debian 9 x64 (Stretch) server
#!/bin/bash
## Install ISPConfig + NGINX + PHP 7.1 on Debian 9 x64 (Stretch)
## Filesystem ext4
## Run as root
## Based on: https://www.howtoforge.com/tutorial/perfect-server-debian-jessie-nginx-bind-dovecot-ispconfig-3.1/
## and: https://www.howtoforge.com/tutorial/perfect-server-debian-9-stretch-apache-bind-dovecot-ispconfig-3-1/
## ! For Postfix config see https://www.howtoforge.com/tutorial/perfect-server-debian-9-stretch-apache-bind-dovecot-ispconfig-3-1/
# Check if user has root privileges
@THEtheChad
THEtheChad / .htaccess
Created January 13, 2012 23:26
Access-Control-Allow-Origin for Subdomains
SetEnvIf Origin "^(.*\.example\.com)$" ORIGIN_SUB_DOMAIN=$1
Header set Access-Control-Allow-Origin "%{ORIGIN_SUB_DOMAIN}e" env=ORIGIN_SUB_DOMAIN
@cbednarski
cbednarski / nginx-error.conf
Created March 13, 2013 04:52
Example nginx.conf for custom error pages
server {
listen 80;
server_name HOSTNAME;
root /opt/PATH/;
index index.html;
rewrite ^/$ /en/PATH/ redirect;
@ogrrd
ogrrd / Cake Composer.md
Last active May 9, 2020 03:30
Install Cake 2.x with Composer

Install CakePHP 2.x with Composer

Remove the main CakePHP lib directory

$ cd /path/to/your/website
$ rm -Rf ./lib

Add the following composer.json file

<html>
<head>
<title>Non-alcoholic Pina Colada</title>
<script type="application/ld+json">
{
"@context": "https://schema.org/",
"@type": "Recipe",
"name": "Non-alcoholic Pina Colada",
"image": [
"https://example.com/photos/1x1/photo.jpg",

Production LAMP server setup on Ubuntu 16.04

Introduction

Summary of the steps to get a Ubuntu 16.04 production server running with LAMP, multiple virtual hosts and Let's Encrypt SSL.

Initial setup

@Linnk
Linnk / nginx_cakephp.dev.conf
Created September 2, 2015 18:44
NGINX configuration file for CakePHP projects with subdirectory
# NGINX Configuration for CakePHP projects with url subdirectories.
#
# In a classic-default-generic CakePHP project you can have as many
# independent applications as you want just by copying the app/
# directory. Apache and the .htaccess files will make the magic, but
# in a nginx server you will need a touch to your virtualhost conf.
#
# So, in order to make this:
#
# example.com/ —> ~/cakephp.dev/app/webroot/index.php
@ZachJiroun
ZachJiroun / OrderAhead.py
Last active May 6, 2023 23:11
Clover V3 REST API Example
__author__ = 'zachj'
import requests
import json
merchantId = 'INSERT YOUR MERCHANT ID HERE'
token = 'INSERT YOUR API TOKEN HERE'
apiToken = '?access_token=' + token
baseURL = 'https://api.clover.com/v3/merchants/' + merchantId + '/'
headers = {'Content-type': 'application/json', 'Accept': 'text/plain'}