Skip to content

Instantly share code, notes, and snippets.

@rgstephens
rgstephens / client.json
Created October 19, 2017 03:25
Client API Swagger JSON Definition
{
"swagger": "2.0",
"info": {
"description": "This is a sample client management API. The YAML definition for this API can be found at [https://gist.github.com/358ef6d256a69084357e139f8c7db19b.git](https://gist.github.com/358ef6d256a69084357e139f8c7db19b.git)",
"version": "0.1.0",
"title": "Client API",
"contact": {
"email": "[email protected]"
},
"license": {
@rgstephens
rgstephens / client.yaml
Last active October 19, 2017 01:31
Client Management REST API Definition
swagger: "2.0"
info:
description: "This is a sample client management API. The YAML definition for this API can be found at [https://gist.github.com/358ef6d256a69084357e139f8c7db19b.git](https://gist.github.com/358ef6d256a69084357e139f8c7db19b.git)"
version: "0.1.0"
title: "Client API"
contact:
email: "[email protected]"
license:
name: "Apache 2.0"
url: "http://www.apache.org/licenses/LICENSE-2.0.html"
@rgstephens
rgstephens / create_field.php
Created October 8, 2017 15:53
WordPress create field wp-cli script
<?php
$all_users = get_users();
foreach( $all_users as $user ) {
$women = get_user_meta($user->ID, 'women_golfing');
$men = get_user_meta($user->ID, 'men_golfing');
if ($men[0] == 'True' || $women[0] == 'True') {
add_user_meta($user->ID, 'course_updates', "True");
WP_CLI::success( "user: " . $user->ID . ", men/women: " . $men[0] . " / " . $women[0]);
} else {
WP_CLI::warning( "user: " . $user->ID . ", men/women: " . $men[0] . " / " . $women[0]);
@rgstephens
rgstephens / google_music_list.js
Last active August 23, 2017 01:07
List songs in Google Music Playlist
var allsongs = []
var outText = "";
var songsToText = function(style, csv, likedonly){
if (style === undefined){
console.log("style is undefined.");
return;
}
var csv = csv || false; // defaults to false
var likedonly = likedonly || false; // defaults to false
if (likedonly) {
@rgstephens
rgstephens / package.json
Last active August 18, 2017 16:43
NativeStarterPro updated package.json with RN 0.46.4
{
"name": "StrapNativeStarter-Pro",
"version": "7.0.0",
"private": true,
"main": "./node_modules/react-native-scripts/build/bin/crna-entry.js",
"scripts": {
"postinstall": "remotedev-debugger",
"start": "react-native-scripts start",
"eject": "react-native-scripts eject",
"android": "react-native-scripts android",
@rgstephens
rgstephens / index.js
Last active July 31, 2017 16:45
Sample Apollo-Server w/Express
import express from 'express';
import bodyParser from 'body-parser';
import { graphqlExpress, graphiqlExpress } from 'apollo-server-express';
import schema from './schema.js'
const PORT = 3000;
const app = express();
console.log('calling app.js');
// bodyParser is needed just for POST.
@rgstephens
rgstephens / schema.js
Created July 31, 2017 02:55
Sample Schema dev-blog.apollodata.com
import { makeExecutableSchema } from 'graphql-tools';
const typeDefs = `
type Author {
id: Int
firstName: String
lastName: String
posts: [Post]
}
type Post {
@rgstephens
rgstephens / maillog
Created June 26, 2017 20:42
/var/log/maillog
Jun 26 20:41:18 270efe9b3c6f postfix[1790]: fatal: parameter inet_interfaces: no local interface found for ::1
Jun 26 20:41:20 270efe9b3c6f postfix[1791]: fatal: parameter inet_interfaces: no local interface found for ::1
Jun 26 20:41:22 270efe9b3c6f postfix[1792]: fatal: parameter inet_interfaces: no local interface found for ::1
Jun 26 20:41:24 270efe9b3c6f postfix[1793]: fatal: parameter inet_interfaces: no local interface found for ::1
Jun 26 20:41:26 270efe9b3c6f postfix[1797]: fatal: parameter inet_interfaces: no local interface found for ::1
Jun 26 20:41:28 270efe9b3c6f postfix[1804]: fatal: parameter inet_interfaces: no local interface found for ::1
Jun 26 20:41:30 270efe9b3c6f postfix[1805]: fatal: parameter inet_interfaces: no local interface found for ::1
Jun 26 20:41:32 270efe9b3c6f postfix[1806]: fatal: parameter inet_interfaces: no local interface found for ::1
Jun 26 20:41:34 270efe9b3c6f postfix[1807]: fatal: parameter inet_interfaces: no local interface found for ::1
Jun 26 20:41:36 270efe9b3
@rgstephens
rgstephens / docker.log
Created June 26, 2017 20:39
docker logs
Installation completed successfully!
- WHAT TO DO TO FINISH THE TULEAP INSTALLATION (see /root/todo_tuleap.txt)
- Your domain name is plex
- Automatically generated passwords are stored in /data/root/.tuleap_passwd
- Customize /etc/tuleap/conf/local.inc and /etc/tuleap/conf/database.inc
- You may also want to customize /etc/httpd/conf/httpd.conf
- Customize /etc/tuleap/site-content information for your site.
- For instance: contact/contact.txt
-
- Default admin credentials are login: admin / password: iDjAKPrjPjrJPed
@rgstephens
rgstephens / myonkyo
Created November 13, 2016 16:05
LIRC config file for Onkyo TX-NR616
# Please make this file available to others
# by sending it to <[email protected]>
#
# this config file was automatically generated
# using lirc-0.9.0-pre1(default) on Sun Nov 13 15:55:42 2016
#
# contributed by
#
# brand: myonkyo
# model no. of remote control: