#Users
- User object
{
id: integer
username: string
email: string
created_at: datetime(iso 8601)
updated_at: datetime(iso 8601)
}
#!/bin/sh | |
# Make sure to: | |
# 1) Name this file `backup.sh` and place it in /home/ubuntu | |
# 2) Run sudo apt-get install awscli to install the AWSCLI | |
# 3) Run aws configure (enter s3-authorized IAM user and specify region) | |
# 4) Fill in DB host + name | |
# 5) Create S3 bucket for the backups and fill it in below (set a lifecycle rule to expire files older than X days in the bucket) | |
# 6) Run chmod +x backup.sh | |
# 7) Test it out via ./backup.sh |
#Users
{
id: integer
username: string
email: string
created_at: datetime(iso 8601)
updated_at: datetime(iso 8601)
}
// Generic Partial Application Function | |
// https://jsbin.com/biyupu/edit?html,js,output | |
// https://gist.github.com/ericelliott/f0a8fd662111ea2f569e | |
// partialApply(targetFunction: Function, ...fixedArgs: Any[]) => | |
// functionWithFewerParams(...remainingArgs: Any[]) | |
const partialApply = (fn, ...fixedArgs) => { | |
return function (...remainingArgs) { | |
return fn.apply(this, fixedArgs.concat(remainingArgs)); | |
}; |
On Twitter the other day, I was lamenting the state of OCSP stapling support on Linux servers, and got asked by several people to write-up what I think the requirements are for OCSP stapling support.
Support for keeping a long-lived (disk) cache of OCSP responses.
This should be fairly simple. Any restarting of the service shouldn't blow away previous responses that were obtained. This doesn't need to be disk, just stable - and disk is an easy stable storage for most server
/* HOC fundamentally is just a function that accepts a Component and returns a Component: | |
(component) => {return componentOnSteroids; } or just component => componentOnSteroids; | |
Let's assume we want to wrap our components in another component that is used for debugging purposes, | |
it just wraps them in a DIV with "debug class on it". | |
Below ComponentToDebug is a React component. | |
*/ | |
//HOC using Class | |
//it's a function that accepts ComponentToDebug and implicitly returns a Class | |
let DebugComponent = ComponentToDebug => class extends Component { |
{ | |
"keys": ["tab"], | |
"command": "expand_abbreviation_by_tab", | |
// put comma-separated syntax selectors for which | |
// you want to expandEmmet abbreviations into "operand" key | |
// instead of SCOPE_SELECTOR. | |
// Examples: source.js, text.html - source | |
"context": [ | |
{ |
var redis = require('redis'); | |
var options = { | |
host: '127.0.0.1', | |
port: '6379' | |
}; | |
var publisher = redis.createClient(options); | |
var subscriber = redis.createClient(options); | |
function sub(message) { |
var copyMergeWordsResultBtn = document.getElementById('button-copy-merge-words-result'); | |
copyMergeWordsResultBtn.addEventListener('click', function (event) { | |
var mergeWordsResultTextarea = document.getElementById('merge-words-result'); | |
mergeWordsResultTextarea.select(); | |
try { | |
var successful = document.execCommand('copy'); | |
var msg = successful ? 'successful' : 'unsuccessful'; | |
console.log('Copying text command was ' + msg); |
/** | |
* Auto update cart after quantity change | |
* | |
* @return string | |
**/ | |
add_action( 'woocommerce_after_cart', 'custom_after_cart' ); | |
function custom_after_cart() { | |
echo '<script> | |
jQuery(document).ready(function($) { |
<?php namespace App\Providers; | |
use Illuminate\Support\ServiceProvider; | |
/** | |
* If the incoming request is an OPTIONS request | |
* we will register a handler for the requested route | |
*/ | |
class CatchAllOptionsRequestsProvider extends ServiceProvider { |