Skip to content

Instantly share code, notes, and snippets.

View oskosk's full-sized avatar

Osk oskosk

  • Automattic
  • Buenos Aires, Argentina
View GitHub Profile
<?php
error_log( print_r( $_POST,true) );
http_response_code(404);
die();
@oskosk
oskosk / .htaccess
Last active February 2, 2019 23:11
Default WordPress .htaccess
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
@oskosk
oskosk / build-gutenberg-master.sh
Last active November 16, 2018 22:17
Script for downloading and building Gutenberg on a Jurassic Ninja site
#!/bin/sh
GUTENBERG_BRANCH=master
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
nvm install 10
@oskosk
oskosk / README.md
Last active December 10, 2018 15:47
  1. Create a JN site with ?gutenberg&jetpack
  2. SSH into it.
  3. Run curl https://gist.githubusercontent.com/oskosk/1b821e70548b065cef1d9c8e6f786089/raw/build-gutenpack.sh --output build-gutenpack.sh && source build-gutenpack.sh
  4. Check the Gutenberg demo page and confirm that the Markdown block is present on the Inserter.
@oskosk
oskosk / deploya.sh
Created August 2, 2018 16:34
jetpack deployer v1
#!/bin/bash
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
nvm install lts/carbon
TEMPO=`mktemp -d`
cd $TEMPO &&
git clone https://github.com/Automattic/jetpack --depth=1 && \
javascript:(function()%7Bvar qs %3D window.location.search %7C%7C "%3F"%3Bvar param %3D 'classic-editor'%3Bif (qs.length > 1) %7Bqs %3D qs %2B "%26"%3B%7Dqs %3D qs %2B param%3Bwindow.location.search %3D qs%7D)()
<?php
/**
* @package HTML Shortcodes
* @version 1.0
*/
/*
Plugin Name: Rational SHortcodes
Author: Osk
*/
@oskosk
oskosk / gist:8cac852c793df5e4946463e2e55dfdd6
Created October 13, 2017 18:14
.htaccess-subdomains-multisite
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
# add a trailing slash to /wp-admin
RewriteRule ^wp-admin$ wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
@oskosk
oskosk / next.sh
Created April 16, 2017 21:28
next.sh
npm init -y
npmAddScript -k dev -v "next dev"
npmAddScript -k build -v "next build"
npmAddScript -k start -v "next start"
npmAddScript -k deploy -v "now && now alias"
npmAddScript -k lint -v "estlint ."
wget https://gist.githubusercontent.com/oskosk/9257f15ade7701017bdfe3ad843efdf0/raw/2c52bfd53adbe8bef659fb472bcfdff84c273960/.eslintrc
npm install --save react react-dom next isomorphic-fetch