Skip to content

Instantly share code, notes, and snippets.

View EOM's full-sized avatar

Sergio N. EOM

View GitHub Profile
@cowboy
cowboy / github_post_recieve.php
Created October 11, 2010 02:04
GitHub PHP webhook to auto-pull on repo push
<?php
// Use in the "Post-Receive URLs" section of your GitHub repo.
if ( $_POST['payload'] ) {
shell_exec( 'cd /srv/www/git-repo/ && git reset --hard HEAD && git pull' );
}
?>hi
@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
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active March 28, 2024 04:34
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@EOM
EOM / cod_lenguaje_pais.sql
Created December 31, 2012 00:37
Tabla, con los Código ISO País, Lenguaje, I18N, para MySQL listo para utilizar en nuestros desarrollos. es_AR, es_BO, pl_BR, Etc.. Yo lo utilizo para vincular con la tabla con todos los IP del mundo que pertenece a cada pais. Mas info: http://www.ipligence.com/faq
/*
MySQL
Target Server Type : MYSQL
Target Server Version : 50022
File Encoding : 65001
Date: 2012-12-30 21:22:23
*/
@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

@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'}
@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
@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(){
@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