Skip to content

Instantly share code, notes, and snippets.

View alisonmonteiro's full-sized avatar
:shipit:
Focusing

Alison Monteiro alisonmonteiro

:shipit:
Focusing
View GitHub Profile
<?php
add_action('pre_get_posts', function() {
if (is_category('my-category')
$query->set('posts_per_page', 4);
});
<defs>
<filter id="dropshadow" height="130%">
<feGaussianBlur in="SourceAlpha" stdDeviation="15"/>
<feOffset dx="1" dy="20" result="offsetblur"/>
<feComponentTransfer>
<feFuncA type="linear" slope="0.1"/>
</feComponentTransfer>
<feMerge>
<feMergeNode/>
<feMergeNode in="SourceGraphic"/>
import test from 'tape';
// answer these questions:
test('What component aspect are you testing?', assert => {
const actual = 'What is the actual output?';
const expected = 'What is the expected output?';
assert.equal(actual, expected,
'What should the feature do?');
<noscript id="deferred-styles">
<link rel="stylesheet" href="style.css"/>
</noscript>
<script>
function loadDeferredStyles() {
var addStylesNode = document.getElementById('deferred-styles');
var replacement = document.createElement('div');
replacement.innerHTML = addStylesNode.textContent;
@alisonmonteiro
alisonmonteiro / form.js
Last active May 29, 2018 17:10
Wordpress Ajax Example
const url = '/wp-admin/admin-ajax.php'
const data = {
action: 'custom_action',
token: document.querySelector('[name="token"]').value,
name: document.querySelector('[name="name"]').value
}
customRequest(url, data) // ...
@alisonmonteiro
alisonmonteiro / Dockerfile
Created December 12, 2019 12:19
create docker image with ecs-cli-v2 installed
FROM docker:19.03
RUN apk add --update \
bash \
git \
openssh \
python \
python-dev \
py-pip \
build-base \
ecs-cli configure profile --profile-name {PROFILE_NAME} --access-key {AWS_ACCESS_KEY} --secret-key {AWS_SECRET_KEY}
ecs-cli configure --cluster {CLUSTER_NAME} --default-launch-type EC2 --region us-east-1 --config-name {PROFILE_NAME}
ecs-cli up --keypair {KEY_PAIR_NAME} --instance-role {INSTANCE_ROLE} --size 1 --instance-type t2.medium --vpc vp-c{VPC_ID} --subnets subnet-{SUBNET_ID}
ecs-cli compose -f docker-compose.ecs.yml service up
@alisonmonteiro
alisonmonteiro / ssh-config-layout
Created December 19, 2019 14:37
SSH config file layout
Host name
HostName ip
User user-name
IdentityFile ~/.ssh/key.pem
@alisonmonteiro
alisonmonteiro / install-docker-linux
Created February 16, 2021 00:11
install-docker-linux
sudo apt-get remove docker docker-engine docker.io containerd runc
sudo apt-get update
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common
ssh-add -l
ssh-add -D
ssh-add ~/.ssh/my-github-key
ssh -T git@github.com