Skip to content

Instantly share code, notes, and snippets.

View jrobinsonc's full-sized avatar
😁
Having fun

Jose Robinson jrobinsonc

😁
Having fun
View GitHub Profile
@jrobinsonc
jrobinsonc / README.md
Last active January 12, 2019 23:16
Class to download packages from a SatisPress installation.

SatisPress Downloader

Usage

$downloader = new \Jrdev\SatisPressDownloader('https://domain.tld/satispress/packages.json', [
    // 'auth' => ['user', 'pass'], // Basic auth, if required.
    // 'baseDir' => __DIR__, // Base directory to create the sub-directories `cache` and `packages`.
    // 'versions' => 1, // How many versions of each package should be downloaded: 1 = the latest, 2 = the two latest versions, etc.
]);

OpenSSL

Verify Certificate Signing Request (.CSR) Contents:

openssl req -noout -text -in test.com.csr

Generate CSR

@jrobinsonc
jrobinsonc / check-db.md
Created September 21, 2018 13:24
WordPress snippet: Check DB with WP CLI

Check the DB of WordPress

Check using the number of tables.

#/bin/bash

while [ true ]
do
 # Number of actual tables in the database.
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \
&& chmod +x /usr/local/bin/composer
<?php
function get_server_memory_usage() {
$free = shell_exec('free');
$free = (string)trim($free);
$free_arr = explode("\n", $free);
$mem = explode(" ", $free_arr[1]);
$mem = array_filter($mem);
$mem = array_merge($mem);
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)-[0-9]+\.(js|css)$ $1.$2 [L]
zend_extension=xdebug.so
xdebug.remote_enable = on
xdebug.remote_connect_back = on
xdebug.idekey = "vagrant"
xdebug.default_enable = 1
xdebug.remote_autostart = 0
xdebug.remote_port = 9000
xdebug.remote_handler=dbgp
xdebug.remote_log="/var/log/xdebug/xdebug.log"
xdebug.remote_host=10.0.2.2
@jrobinsonc
jrobinsonc / _readme.md
Created February 13, 2018 05:22 — forked from lambdahands/_readme.md
FlowType and CSS Modules

Huh?

So basically FlowType doesn't know about CSS Modules, a really handy way of dealing with the plagues of CSS in codebases (global variables and dependency wackiness mainly).

What WebPack allows us to do is "require" CSS files and use their class names:

import styles from "my_styles.css";
import React from "react";

Adding favicon to header:

add_action('wp_head', function () {
    printf('<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">');
});

Do logging programmatically

@jrobinsonc
jrobinsonc / php.sublime-build
Created October 18, 2017 15:53 — forked from fabiobruna/php.sublime-build
PHP Lint build system for Sublime Text 3
{
"cmd": ["php", "-l", "$file"],
"file_regex": "^.* in (...*?) on line ([0-9]*)",
"selector": "source.php"
}