Skip to content

Instantly share code, notes, and snippets.

Michael mazz

Block or report user

Report or block mazz

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View request.ts
import axios from 'axios'
import { Message, MessageBox } from 'element-ui'
import { UserModule } from '@/store/modules/user'
const service = axios.create({
baseURL: process.env.VUE_APP_BASE_API, // url = base url + request url
timeout: 5000
// withCredentials: true // send cookies when cross-domain requests
})
View dialog_chunk.vue
<template>
<div class="app-container">
<el-dropdown trigger="click" @command="handleSetChannel">
<div>
<el-col :span="4" class="text-center">
<router-link class="pan-btn green-btn" to="/table/complex-table">
Select Channel
</router-link>
</el-col>
</div>
@mazz
mazz / add_playlist.ex
Last active Nov 9, 2019
how to make a list of maps/structs
View add_playlist.ex
def add_playlist(
ordinal,
basename,
small_thumbnail_path,
med_thumbnail_path,
large_thumbnail_path,
banner_path,
media_category,
localized_titles,
channel_id
View channel.ex
defmodule Db.Schema.Channel do
use Ecto.Schema
import Ecto.Changeset
alias Db.Type.ChannelHashId
@derive {Jason.Encoder, only: [
:basename,
:ordinal,
:small_thumbnail_path,
:med_thumbnail_path,
@mazz
mazz / query.ex
Created Nov 2, 2019
field `taskcategories` in `select` is a virtual field in schema Db.Schema.Task in query:
View query.ex
query =
from(task in Task,
join: org in Org,
join: rubric in Rubric,
join: coursecode in CourseCode,
join: task_category in TaskCategory,
where: org.uuid == ^org_uuid,
where: org.id == task.org_id,
where: rubric.id == task.rubric_id,
where: coursecode.id == task.coursecode_id,
@mazz
mazz / query.ex
Created Nov 2, 2019
query the task_category list and then do this query?
View query.ex
query =
from(task in Task,
join: org in Org,
join: rubric in Rubric,
join: coursecode in CourseCode,
join: task_category in TaskCategory,
where: org.uuid == ^org_uuid,
where: org.id == task.org_id,
where: rubric.id == task.rubric_id,
where: coursecode.id == task.coursecode_id,
@mazz
mazz / query.ex
Created Nov 1, 2019
** (Ecto.Query.CompileError) `from_struct(rubric)` is not a valid query expression.
View query.ex
query =
from(task in Task,
join: org in Org,
join: rubric in Rubric,
where: org.uuid == ^org_uuid,
where: org.id == task.org_id,
where: rubric.id == task.rubric_id,
select: %{
title: task.task_title,
uuid: task.uuid,
View ValueObservation.swift
let databasePool: DatabasePool = self.userService.rawDatabasePool()
let coursesObservation = ValueObservation.tracking { db -> [MbyCourse] in
var courses: [MbyCourse] = []
do {
let mbyCourses = try MbyCourse
.filter(Column("orgUuid") == self.orgUuid.value) // also tried removing this filter line
.filter(Column("archived") == false) // also tried removing this filter line
.fetchAll(db)
courses = mbyCourses
View deploy.log
Attaching to faithfulword-phx_proxy_1, faithfulword-phx_postgres_1, faithfulword-phx_faithful_word_1
proxy_1 | time="2019-10-09T02:19:28Z" level=info msg="Traefik version v1.7.18 built on 2019-09-26_01:56:30PM"
proxy_1 | time="2019-10-09T02:19:28Z" level=info msg="\nStats collection is disabled.\nHelp us improve Traefik by turning this feature on :)\nMore details on: https://docs.traefik.io/v1.7/basics/#collected-data\n"
proxy_1 | time="2019-10-09T02:19:29Z" level=info msg="Preparing server http &{Address::80 TLS:<nil> Redirect:<nil> Auth:<nil> WhitelistSourceRange:[] WhiteList:<nil> Compress:false ProxyProtocol:<nil> ForwardedHeaders:0xc0009500e0} with readTimeout=0s writeTimeout=0s idleTimeout=3m0s"
proxy_1 | time="2019-10-09T02:19:29Z" level=info msg="Preparing server https &{Address::443 TLS:0xc0004b4480 Redirect:<nil> Auth:<nil> WhitelistSourceRange:[] WhiteList:<nil> Compress:false ProxyProtocol:<nil> ForwardedHeaders:0xc0009501a0} with readTimeout=0s writeTimeout=0s
@mazz
mazz / stuff.ex
Created Feb 20, 2019
Phoenix.Template.UndefinedError
View stuff.ex
Phoenix.Template.UndefinedError at GET /
Could not render "app.html" for WordApi.LayoutView, please define a matching clause for render/2 or define a template at "lib/faithful_word_api/templates/layout". No templates were compiled for this module. Assigns:
%{__phx_template_not_found__: WordApi.LayoutView, conn: %Plug.Conn{adapter: {Plug.Cowboy.Conn, :...}, assigns: %{layout: {WordApi.LayoutView, "app.html"}}, before_send: [#Function<0.116269836/1 in Plug.CSRFProtection.call/2>, #Function<2.65282597/1 in Phoenix.Controller.fetch_flash/2>, #Function<0.58261320/1 in Plug.Session.before_send/2>, #Function<1.112466771/1 in Plug.Logger.call/2>, #Function<0.66982185/1 in Phoenix.LiveReloader.before_send_inject_reloader/2>], body_params: %{}, cookies: %{"cookieconsent_status" => "dismiss"}, halted: false, host: "localhost", method: "GET", owner: #PID<0.736.0>, params: %{}, path_info: [], path_params: %{}, port: 4000, private: %{WordApi.Router => {[], %{}}, :phoenix_action => :index, :phoenix_controller => WordApi.Pa
You can’t perform that action at this time.