- Sage doesn't come with Purgecss (or uncss, etc.)
- Say, we use Bulma -- suddenly
dist/main.css
grows by 400K! - Let's purge it!
- Oh dang, we need to whitelist
/\.wp-/
,/\.post-type/
,/myfancylightbox/
... - Wait we are whitelisting pretty much everything from
/resource/assets/styles
! - Isn't there an option to purge
/node_modules/**/*
only? - Nope.
purgecss start ignore
, strategically placed, to the rescue!
/* eslint-env node */ | |
/* eslint-disable no-console, dot-notation */ | |
const fse = require('fs-extra'); | |
const readline = require('readline'); | |
// const platform = 'mw_less'; | |
// const platform = 'mw_scss'; | |
const platform = 'cosmos'; |
<?php | |
class WP_HTML_Compression | |
{ | |
// Settings | |
protected $compress_css = true; | |
protected $compress_js = true; | |
protected $info_comment = true; | |
protected $remove_comments = true; | |
// Variables |
--- | |
- name: Sync uploads between environments | |
hosts: web | |
remote_user: "{{ web_user }}" | |
vars: | |
project: "{{ wordpress_sites[site] }}" | |
project_root: "{{ www_root }}/{{ site }}" | |
tasks: |
For Buddy to be able to update NGINX and run other commands as root, you need to follow these steps to give the user buddy access. | |
If no user has been created, follow the guide here to create a user for Buddy: | |
https://www.digitalocean.com/community/tutorials/how-to-add-and-delete-users-on-ubuntu-16-04 | |
1. On ubuntu based systems, run " $ sudo visudo " | |
2. this will open /etc/sudoers file. | |
3. If your buddy user is already in that file, then modify to look like this: | |
buddy ALL=(ALL) NOPASSWD: ALL |
It's pretty easy to do polymorphic associations in Rails: A Picture can belong to either a BlogPost or an Article. But what if you need the relationship the other way around? A Picture, a Text and a Video can belong to an Article, and that article can find all media by calling @article.media
This example shows how to create an ArticleElement join model that handles the polymorphic relationship. To add fields that are common to all polymorphic models, add fields to the join model.
I hereby claim:
- I am jameslutley on github.
- I am jameslutley (https://keybase.io/jameslutley) on keybase.
- I have a public key ASB1xBLj-Q_Nnw0gg0vQrWLegSokRL9XICKTKwrrUUMoEAo
To claim this, I am signing this object:
Laravel-Mix is "an elegant wrapper around Webpack for the 80% use case". It has nothing to do with Elixir's Mix and does not require Laravel to work!
Create a new phoenix application with mix phx.new
. You may choose to add the --no-brunch
flag to stop brunch from being intiailized, but I personally prefer leaving that in and replacing brunch so that the folder structure is set up for me.
$ mix phx.new demo
I recently spent some time dealing with nested forms in Phoenix. Nested forms are great when you want to create multiple database records in a single transaction and associate them with each other. I am new to Phoenix and really struggled to find any resources that helped me with my specific problem. I decided to document what I learned in the process in hopes of helping others that are new to Elixir and Phoenix.
Here is my attempt at a one stop shop to learn everything you will need to know about nested forms. If you would like to view the GitHub repo you can check it out here.
Thanks to Heartbeat and Jose for excellent blog posts on nested forms. Also shoutout to Josh for showing me some examples at Ruby