Skip to content

Instantly share code, notes, and snippets.

Avatar

Daniel Madalitso Phiri malgamves

View GitHub Profile
@malgamves
malgamves / script.js
Last active Aug 22, 2019
problematic script.js
View script.js
var mspaint = {
sketchSelector: "",
paintSelector: "",
paintContext: null,
currentIcon: null,
canvas: null,
start: function(selector1, selector2) {
this.sketchSelector = selector1;
this.paintSelector = selector2;
View app.js
const pubnub = new PubNub({
publishKey: 'ENTER_YOUR_PUBLISH_KEY_HERE',
subscribeKey: 'ENTER_YOUR_SUBSCRIBE_KEY_HERE'
});
let drawChannel = "draw";
let chatChannel = "chat";
let colorChannel = "color";
/* Drawing Section */
View main.css
body, html {
margin: 0;
padding: 0;
height: 100%; }
div.about {
display: none;
}
/* The Modal (background) */
View index.html
<html>
<head>
<title>_Beep Boop Beep_*printing.....*</title>
<meta name="description" content="" />
<meta name="author" content="Daniel Madalitso Phiri" />
<link rel="stylesheet" href="src/main.css" />
<link rel="stylesheet" type="text/css" href="src/clippy.css" media="all" />
</head>
<body>
@malgamves
malgamves / Resume.gif
Last active May 9, 2019
Daniel Madalitso Phiri - CV
@malgamves
malgamves / about-me.md
Last active Jun 4, 2019
Need a Developer Advocate? Hire Me 🤷‍♂️
View about-me.md

Developer Advocate
Python, JavaScript and GraphQL
Community Lead & Speaker

Daniel Madalitso Phiri

🦖

View graphql.js
import gql from 'graphql-tag'
export const ADD_VOTE_MUTATION = gql`
mutation updateVotes($id: Int!) {
update_characters(where: {id: {_eq: $id}},
_inc: {votes: 1}) {
affected_rows
}
}
`;
@malgamves
malgamves / BarChart.js
Created May 4, 2019
Chart.js BarChart Template
View BarChart.js
// CommitChart.js
import { HorizontalBar, mixins } from 'vue-chartjs'
const { reactiveProp } = mixins
export default {
extends: HorizontalBar,
mixins: [reactiveProp],
props: {
chartData: {
@malgamves
malgamves / App.vue
Last active May 5, 2019
App.vue for a realtime Vue App using GraphQL
View App.vue
<template>
<div id="app">
<div class="container">
<div class="row">
<div class="column">
<h2>Who Might Die ⚔️</h2>
</div>
<div class="column">
<h2
v-if="loading"
@malgamves
malgamves / main.js
Created May 4, 2019
Main.js file for a Realtime Vue App using GraphQL
View main.js
import { ApolloClient } from 'apollo-client'
import { WebSocketLink } from 'apollo-link-ws';
import { HttpLink } from 'apollo-link-http';
import { split } from 'apollo-link';
import { getMainDefinition } from 'apollo-utilities';
import { InMemoryCache } from 'apollo-cache-inmemory';
import Vue from 'vue'
import VueApollo from 'vue-apollo'
import App from './App'
You can’t perform that action at this time.