Skip to content

Instantly share code, notes, and snippets.

View Grantimus9's full-sized avatar

Grant Nelson Grantimus9

  • TripleLift Inc
  • DC
View GitHub Profile
# example custom_data with 2 keys; one the changeset and the other the manually jsonified errors key.
{
"chgset": {
"action": "update",
"changes": {
"dataimport_id": 423
},
"constraints": [],
"data": {
{
"data": {
"website_url": "https://www.meansdatabase.org",
"email_root_domain": "meansdatabase.org",
"zip": "20006-1631",
"tax_period": 201712,
"subsection": 3,
"street": "1629 K ST NW STE 300",
"status": 1,
"state": "DC",
defmodule ApiInterface do
@moduledoc """
An interface for calling api.service.com for argument "argument"
"""
# Suppose this function is throwing "no function clause matching in ApiInterface.make_some_call/1"
def make_some_call(argument) do
# Does this block go here?
Appsignal.Span.set_sample_data(
Appsignal.Tracer.root_span,
@Grantimus9
Grantimus9 / elixir.yml
Last active August 16, 2020 04:04
Github Actions Elixir.yml file that works on my Elixir Phoenix apps using Postgres, such as on Heroku
name: Elixir CI
on:
push:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
@Grantimus9
Grantimus9 / App.vue
Created January 5, 2018 17:16
App.Vue with GraphQL querying example.
<template>
<div id="app">
<h1>{{ msg }}</h1>
<h2>The following was loaded over Graphql:</h2>
<h1>User: {{ user.name }}</h1>
</div>
</template>
<script>
import gql from 'graphql-tag'
<template>
<div id="app">
<h1>{{ msg }}</h1>
</div>
</template>
<script>
export default {
name: 'app',
@Grantimus9
Grantimus9 / app.js
Last active March 13, 2018 13:33
The main entry point, app.js, for this example app.
// First we import the various pieces of Vue and Apollo.
import Vue from 'vue'
import { ApolloClient } from 'apollo-client'
import { InMemoryCache } from 'apollo-cache-inmemory'
import { HttpLink } from 'apollo-link-http'
import VueApollo from 'vue-apollo'
// Import our main app component, the top-level container for our app.
# snipped
# Change the watchers: line list to read like this one.
config :appname, AppnameWeb.Endpoint,
http: [port: 4000],
debug_errors: true,
code_reloader: true,
check_origin: false,
watchers: [
node: ["node_modules/webpack/bin/webpack.js", "--watch", "--colors",
cd: Path.expand("../assets", __DIR__)
var path = require('path')
var webpack = require('webpack')
module.exports = {
entry: './src/app.js',
output: {
path: path.resolve(__dirname, '../priv/static/js'),
publicPath: '/dist/',
filename: 'app.js'
},
@Grantimus9
Grantimus9 / package.json
Created January 5, 2018 16:41
Package.json for a Phoenix 1.3, GraphQL, Apollo App.
{
"name": "your-project-name",
"description": "A Vue.js, GraphQL, and Elixir project",
"version": "1.0.0",
"author": "You <you@you.com>",
"license": "MIT",
"private": true,
"scripts": {
"dev": "cross-env NODE_ENV=development webpack-dev-server --open --hot",
"build": "cross-env NODE_ENV=production webpack --progress --hide-modules"