Skip to content

Instantly share code, notes, and snippets.

View ckhrysze's full-sized avatar

Chris ckhrysze

View GitHub Profile
@ckhrysze
ckhrysze / mix.exs
Created October 3, 2018 18:08
distillery split after
defmodule Systematize.Mixfile do
use Mix.Project
# ...
defp deps do
[
{:phoenix, "~> 1.3.3"},
{:phoenix_pubsub, "~> 1.0"},
{:phoenix_html, "~> 2.10"},
@ckhrysze
ckhrysze / mix.exs
Last active October 3, 2018 18:04
distillery split before
defmodule Systematize.Mixfile do
use Mix.Project
# ...
defp deps do
[
{:phoenix, "~> 1.3.3"},
{:phoenix_pubsub, "~> 1.0"},
{:phoenix_html, "~> 2.10"},
@ckhrysze
ckhrysze / between_example.ex
Last active June 27, 2018 18:11
Timex between? example
defmodule Test436 do
def test do
IO.puts("Testing Daylight Savings issue 436")
# demonstrate both styles of creating elixir time structs
start = ~T[09:00:00]
{:ok, stop} = Time.new(12, 0, 0)
# will be true when the current time is between 9am and noon in
# los angeles and anywhere else in the same timezone, with respect to
sql = "select * from example as ex cross join jsonb_each(ex.data) as dt where value->>'ref' = 'ref_1';"
result = JsonbTest.Repo.query!(sql)
Enum.map(result.rows, &JsonbTest.Repo.load(Example, {result.columns, &1}))
@ckhrysze
ckhrysze / google_sheets.py
Created January 5, 2018 06:47
Google sheet creation and owner assignment
from apiclient import discovery
from google.auth.transport.urllib3 import AuthorizedHttp
def change_owner(spreadsheet_id, owner):
'''
Use the drive api to change the owner
'''
drive_service = discovery.build('drive', 'v3')
permission = drive_service.permissions().create(
Verifying my Blockstack ID is secured with the address 195fc1q7Q2gL4q5HNnTFPREJAxmMKUjT9r https://explorer.blockstack.org/address/195fc1q7Q2gL4q5HNnTFPREJAxmMKUjT9r
<template>
<div id="app">
<table>
<tr v-for="week in weeks">
<td v-for="day in week.days">
<div v-show="day.display" class="day">
<div class="day-header">
{{day.display}}
</div>
<div class="day-events">
@ckhrysze
ckhrysze / vue_mpa_dist_tree
Created October 4, 2017 16:43
Output of vue mpa process
dist
├── about.html
├── about.js
├── index.html
└── index.js
@ckhrysze
ckhrysze / vue_mpa_src_tree
Created October 4, 2017 16:39
multi-page vue directory tree
├── LICENSE
├── package.json
├── package-lock.json
├── README.md
├── src
│ ├── components # all vue files
│ │ ├── about.vue
│ │ ├── index.vue
│ │ ├── site_footer.vue
│ │ └── site_header.vue
@ckhrysze
ckhrysze / webpack.config.js
Last active October 4, 2017 16:31
Multi-page Vue Webpack config
const { join, resolve } = require('path')
const webpack = require("webpack");
const glob = require('glob')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const chunk_names = {}
glob.sync('./src/pages/**/app.js').forEach(path => { // build out a chunk for
let chunk = path.split("/")[3] // each folder (page) under
chunk_names[chunk] = path // the pages directory
})