Skip to content

Instantly share code, notes, and snippets.

View jmcneese's full-sized avatar

Joshua McNeese jmcneese

View GitHub Profile

Keybase proof

I hereby claim:

  • I am jmcneese on github.
  • I am jmcneese (https://keybase.io/jmcneese) on keybase.
  • I have a public key ASBsoNmBjnAlNS0XSV7eMa4Qf9kuDVAo0v_WdSHxKJJ-cwo

To claim this, I am signing this object:

@jmcneese
jmcneese / communityType.js
Created July 10, 2018 21:01
modular graphql schema
// schema/types/community.js
import { GraphQLBoolean, GraphQLObjectType, GraphQLString } from 'graphql';
import { connectionArgs, globalIdField } from 'graphql-relay'; // relay-specific
// if you are using relay, you'd define an interface for nodes, and include it here
import { nodeInterface } from 'schema/lib/node';
/**
* Community type
*/
@jmcneese
jmcneese / doSignIn.js
Last active April 5, 2018 03:16
Relay/GraphQL signIn/signOut mutation
relay.commitUpdate(
new SignInMutation({ username, password, viewer }), {
onSuccess: ({ signIn: { viewer: { token } } }) => {
// do something with the returned token, set it in localStorage or cookies, or whatever
},
onFailure: (transaction) => {
// handle the failed mutation
},
}
);
@jmcneese
jmcneese / build.xml
Last active November 21, 2016 14:39 — forked from vdubyna/build.xml
<?xml version="1.0" encoding="UTF-8"?>
<project name="Application" default="build" basedir="../">
<target name="build" depends="prepare,phpunit,phpmd,phpcpd,phpdoc,phpcb,phpdcd,phploc,phpcs"/>
<property name="applicationDir" value="${basedir}/source" />
<property name="buildDir" value="${basedir}/build" />
<target name="prepare">
<mkdir dir="${buildDir}/logs" />
### Keybase proof
I hereby claim:
* I am jmcneese on github.
* I am jmcneese (https://keybase.io/jmcneese) on keybase.
* I have a public key whose fingerprint is 81BD 1DB1 0E63 D9FB 799C 5E75 6017 4AB1 6653 0BBD
To claim this, I am signing this object:
git checkout integration;for branch in `git branch --merged | grep -v master | grep -v integration`; do git branch -d $branch && git push origin :$branch; done
Router::connect('/event/:slug/participants/*', array(
'controller' => 'events',
'action' => 'participants'
), array(
'slug' => '[a-zA-Z0-9_-]+',
'pass' => array('slug')
));
// url /event/foo/participants is answered correctly.
// result: paginator links are /events/participants/foo/page:2