Skip to content

Instantly share code, notes, and snippets.

View aswinmprabhu's full-sized avatar
🚀
Building cool stuff

Aswin M Prabhu aswinmprabhu

🚀
Building cool stuff
View GitHub Profile
// serve the merged schema
makeMergedSchema().then(mergedSchema => {
// Create a new apollo server
const server = new ApolloServer({ schema:mergedSchema });
server.listen({port: 3000})
.then(({ url }) => {
console.log(`🚀 Server ready at ${url}`);
})
import {
makeRemoteExecutableSchema,
introspectSchema,
} from 'graphql-tools';
import fetch from 'node-fetch';
import { HttpLink } from 'apollo-link-http';
// To satisfy Extend peer dependencies
import 'apollo-link';
const createRemoteExecutableSchema = async () => {
const makeCustomResolver = (userSchema) => {
// Create custom resolvers
const customResolver = {
Mutation: {
insert_user(parent, args, context, info){
let newArgs = { objects:[] };
// Convert the email to lower case and append each object to the new arguments array
for (const user of args.objects) {
user.email = user.email.toLowerCase();
newArgs.objects.push(user);
import { mergeSchemas } from 'graphql-tools';
const makeMergedSchema = async () => {
const userSchema = await createRemoteExecutableSchema();
const customResolver = makeCustomResolver(userSchema);
// merge the two schemas
const mergedSchema = mergeSchemas({
schemas: [userSchema],
package main
import (
"fmt"
"github.com/cloudlibz/gocloud/rackspaceauth"
)
func main() {
rackspaceauth.LoadConfigAndAuthenticate()
@aswinmprabhu
aswinmprabhu / firebase-react-class.js
Last active May 8, 2019 21:31
Firebase real-time chatroom app using react class based components
class App extends Component {
constructor() {
super();
this.state = {
joined: false,
nickname: "",
email: "",
msg: "",
messages: {},
};
function App() {
const [nickname, setNickname] = useState("");
const [email, setEmail] = useState("");
const [joined, setJoined] = useState(false);
const [msg, setMsg] = useState("");
const [messages, setMessages] = useState({});
const chatRoom = db.ref().child('chatrooms').child('global');
useEffect(() => {
#include <bits/stdc++.h>
using namespace std;
string decode(string str)
{
stack<int> numstack;
stack<char> charstack;
string nstr;
for (int i = 0; str[i] != '\0'; i++)
{
#include <bits/stdc++.h>
using namespace std;
string nstr;
string decode(string str, int *i)
{
string retval;
while (*i < str.length() && str[*i] != ']')
{
if (!isdigit(str[*i]))

Google Summer of Code Final Submission

Student - Aswin M Prabhu

Organization - Moira

Project - Adding support for additional delivery channels to Moira

The initial aim of the project as stated in my proposal was to add support for additional delivery channels to Moira. Moira is a real-time alerting tool, based on Graphite data. Delivery channels are integrations with other services such as Slack or email used to alert users. The proposed channels included popular on-call incident management tools like PagerDuty, VictorOps, Opsgenie, team chat apps like Discord and voice and SMS API providers like Nexmo. During these 3