Skip to content

Instantly share code, notes, and snippets.

Max Castro kaioken

Block or report user

Report or block kaioken

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@kaioken
kaioken / wp_post_migration.php
Last active Sep 9, 2019
Wordpress Post Migration
View wp_post_migration.php
<?php
/**
* Wordpress migration from another wordpress site via its API
*/
$path = '/home/websitefolder/public';
$wordpressUrl = 'https://migratingwordpresssite.com';
$redisHost = '127.0.0.1';
View install-rabbitmq-centos-7.md

Install RabbitMQ on CentOS 7

sudo yum -y install epel-release
sudo yum -y update

Install Erlang

Download repository

View .php_cs
<?php
return PhpCsFixer\Config::create()
->setRules([
'@PSR2' => true,
'array_indentation' => true,
'array_syntax' => ['syntax' => 'short'],
'combine_consecutive_unsets' => true,
'method_separation' => true,
'no_multiline_whitespace_before_semicolons' => true,
@kaioken
kaioken / postmortem.md
Created Jan 17, 2019 — forked from mlafeldt/postmortem.md
Example Postmortem from SRE book, pp. 487-491
View postmortem.md

Shakespeare Sonnet++ Postmortem (incident #465)

Date

2015-10-21

Authors

  • jennifer
  • martym
@kaioken
kaioken / mailgunreport.php
Last active Nov 5, 2018
Mailgun Report via API using PHP
View mailgunreport.php
<?php
require_once __DIR__ . '/../vendor/autoload.php';
/**
* Get mailgun report
*
* @param string $url
* @return array
*/
@kaioken
kaioken / service.php
Created Oct 27, 2018
PhalconPHP Sentry.io Integration with Monolog
View service.php
<?php
/**
* System Log using monolog
*/
$di->set('log', function ($file = 'debug') use ($config, $di) {
// Create the logger
$logger = new MonoLogger('GEWAER.API');
$client = new Raven_Client('https://' . getenv('SENTRY_RPOJECT_SECRET') . '@sentry.io/' . getenv('SENTRY_PROJECT_ID'));
@kaioken
kaioken / GitConfigHttpProxy.md
Created Oct 10, 2018 — forked from evantoli/GitConfigHttpProxy.md
Configure Git to use a proxy
View GitConfigHttpProxy.md

Configure Git to use a proxy

##In Brief

You may need to configure a proxy server if you're having trouble cloning or fetching from a remote repository or getting an error like unable to access '...' Couldn't resolve host '...'.

Consider something like:

@kaioken
kaioken / books.md
Created Oct 10, 2018 — forked from abstractart/books.md
Free Programming Ebooks - O'Reilly Media. Codeship free ebooks here - https://bit.ly/2oQ0knQ
View books.md
@kaioken
kaioken / change_primary_key.md
Created Oct 10, 2018 — forked from scaryguy/change_primary_key.md
How to change PRIMARY KEY of an existing PostgreSQL table?
View change_primary_key.md
-- Firstly, remove PRIMARY KEY attribute of former PRIMARY KEY
ALTER TABLE <table_name> DROP CONSTRAINT <table_name>_pkey;
-- Then change column name of  your PRIMARY KEY and PRIMARY KEY candidates properly.
ALTER TABLE <table_name> RENAME COLUMN <primary_key_candidate> TO id;
@kaioken
kaioken / read-access.sql
Created Sep 21, 2018 — forked from oinopion/read-access.sql
How to create read only user in PostgreSQL
View read-access.sql
-- Create a group
CREATE ROLE readaccess;
-- Grant access to existing tables
GRANT USAGE ON SCHEMA public TO readaccess;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO readaccess;
-- Grant access to future tables
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO readaccess;
You can’t perform that action at this time.