Skip to content

Instantly share code, notes, and snippets.

Avatar
🍰
is a lie

Dmitry Chirkin josser

🍰
is a lie
View GitHub Profile
View front.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
View test.js
function timedLog(value, ms) {
return new Promise((resolve, reject) => {
setTimeout(() => {
console.log(value)
resolve()
}, ms)
})
}
async function doSomething() {
View proxy.js
// @ts-nocheck
import vm from 'vm'
import _debug from 'debug'
const debug = _debug('wf:enhancer')
class WObject {
constructor(source: any) {
this._w = source
return new Proxy(this, {
View factory2.ts
interface StoreOptions {
}
interface DbStoreOptions extends StoreOptions {
dsn: string
}
interface FileStoreOptions extends DbStoreOptions {
path: string
View test.ts
interface StoreOptions {
}
interface DbStoreOptions extends StoreOptions {
dsn: string
}
interface FileStoreOptions extends DbStoreOptions {
path: string
View schema.ts
import { gql } from 'apollo-server-koa'
import { find, filter } from 'lodash'
const authors = [
{ id: 1, name: 'J.K. Rowling' },
{ id: 2, name: 'Michael Crichton' }
]
const books = [
{
@josser
josser / .phoenix.js
Last active Dec 3, 2019
Phoenix config
View .phoenix.js
'use strict';
var keys = [];
var controlAlt = [ 'ctrl', 'alt' ];
var margin = 0;
var increment = 0.1
function log() {
Phoenix.log(JSON.stringify(arguments[0], true, 2));
}
View db_sync.sh
#!/bin/bash
DB_TARGET_NAME='techcheck-dev';
DB_TARGET_USER='postgres';
DB_TARGET_PW='postgres';
DB_TARGET_HOST='';
DB_TARGET_PORT='5432';
DB_SOURCE_NAME='';
DB_SOURCE_USER='';
View .phoenix.js
'use strict';
var keys = [];
var controlAlt = [ 'ctrl', 'alt' ];
var margin = 0;
var increment = 0.1
function log() {
Phoenix.log(JSON.stringify(arguments[0], true, 2));
}
View index.js
import fs from 'fs'
import path from 'path'
import Sequelize from 'sequelize'
import config from '../config'
const sequelize = new Sequelize(
config.db.database, config.db.username, config.db.password, config.db.options
)
const db = {}