Skip to content

Instantly share code, notes, and snippets.

fetch('https://www.tweetjs.com/API.aspx', {
body: JSON.stringify({
Action: 'ListTweetsOnUserTimeline',
ScreenName: 'urre',
}),
method: 'POST',
})
.then((r) => r.json())
.then((data) => {
console.log(data)
@urre
urre / custom-feed.php
Created December 14, 2019 14:46
WordPress Custom RSS feed
<?php
/*
Plugin Name: Custom RSS Feed for App
Description: A plugin creating a customized rssfeed
Plugin URI: https://urre.me/
Author: Urban Sandén
Author URI: https://urre.me
*/
// Add dates for rss feed
@urre
urre / config.yml
Last active June 28, 2019 07:30
CircleCI config for WordPress with Bedrock
version: 2
jobs:
build:
working_directory: ~/clone
docker:
- image: circleci/php:7.1-node-browsers
steps:
- checkout
@urre
urre / config.yml
Created December 7, 2018 13:37
Circle CI config for Jekyll
version: 2
jobs:
build:
docker:
- image: circleci/ruby:2.5.0-node
working_directory: ~/repo
steps:
- checkout
@urre
urre / example.md
Last active August 20, 2018 16:26
Example, Bedrock on Codeship

1. Initial setup

  • 1.1 First setup the ENV variables under Environment
  • 1.2 Authorize the project specific Codeship ssh key on the server. (under General)

2. Setup tab

phpenv local 7.2
@urre
urre / test.sh
Created February 2, 2018 10:32
composer test command
composer test
@urre
urre / setup.sh
Created February 2, 2018 10:31
codeship setup command
phpenv local 7.2
composer install --prefer-source --no-interaction
@urre
urre / output.sh
Created February 2, 2018 10:31
test output
FILE: ...rojects/myproject/myfile.php
----------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 4 LINES
----------------------------------------------------------------------
34 | ERROR | [x] Expected 1 spaces before closing bracket; 0 found
36 | ERROR | All output should be run through an escaping function
| | (see the Security sections in the WordPress Developer
| | Handbooks), found '$image_src'.
90 | ERROR | [x] String "Create a Configuration File" does not require
| double quotes; use single quotes instead
"scripts": {
"post-install-cmd": "./vendor/bin/phpcs --config-set installed_paths vendor/wp-coding-standards/wpcs",
"post-update-cmd" : "./vendor/bin/phpcs --config-set installed_paths vendor/wp-coding-standards/wpcs",
"test": [
"phpcs --report=full --colors -p --standard=web/app/themes/mytheme/codesniffer-ruleset.xml --ignore=*/vendor/*,*/node_modules/* web/app/themes/mytheme/ --extensions=php"
]
}
@urre
urre / gist:e06e8113d3858842abe3135f9dc85f1e
Last active February 2, 2018 10:30
composer scripts
"scripts": {
"post-install-cmd": "./vendor/bin/phpcs --config-set installed_paths vendor/wp-coding-standards/wpcs",
"post-update-cmd" : "./vendor/bin/phpcs --config-set installed_paths vendor/wp-coding-standards/wpcs"
}