Skip to content

Instantly share code, notes, and snippets.

@ligne13
ligne13 / gist:4a5ac179c694520f492969b03b7d09d1
Created October 18, 2019 13:22
[nginx] Use images from production in local website
location ~ ^/wp-content/uploads/(.*) {
rewrite ^/wp-content/uploads/(.*)$ https://www.example.com/wp-content/uploads/$1 permanent;
}
@atillay
atillay / gitlab-ci.yml
Last active October 29, 2024 14:58
Deploy to Gandi Simple Hosting with Gitlab CI (and build assets with NPM)
image: node:lts-slim
before_script:
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client git -y )'
- mkdir -p ~/.ssh
- eval $(ssh-agent -s)
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
- ssh-add <(echo "$SSH_PRIVATE_KEY")
stage_deploy:
@ikennaokpala
ikennaokpala / nfs-vagrant-error.md
Last active January 13, 2025 13:03
Vagrant error :NFS is reporting that your exports file is invalid

Vagrant error :NFS is reporting that your exports file is invalid

==> default: Exporting NFS shared folders...
NFS is reporting that your exports file is invalid. Vagrant does
this check before making any changes to the file. Please correct
the issues below and execute "vagrant reload":

exports:2: path contains non-directory or non-existent components: /Users/<username>/path/to/vagrant
exports:2: no usable directories in export entry
exports:2: using fallback (marked offline): /
@timersys
timersys / gist:03067ac7594fdce288ca
Last active May 18, 2019 15:15
Wordpress popups plugin. Allow editors to edit popups
<?php // <-- don't add this in your functions.php if already there
/**
* https://wordpress.org/support/plugin/popups
* Allow editors to edit popups
* For more roles check https://codex.wordpress.org/Roles_and_Capabilities
*/
add_filter('spu/settings_page/roles', 'my_custom_role');
function my_custom_role(){
return 'edit_others_posts';
}
@jlong
jlong / uri.js
Created April 20, 2012 13:29
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@marklindhout
marklindhout / gist:2274861
Created April 1, 2012 11:45
Use xgettext to create default.pot from all PHP files in a directory (recursive), and place it in /languages/.
xgettext --from-code=utf-8 -k_e -k_x -k__ -o languages/default.pot $(find . -name "*.php")