Skip to content

Instantly share code, notes, and snippets.

import { ApolloServer, gql } from "apollo-server-micro";
import { makeExecutableSchema } from "graphql-tools";
import { User } from "../../utils/db";
const typeDefs = gql`
type User {
id: ID!
name: String!
email: String!
}
@jmas
jmas / draft.ts
Last active October 13, 2020 10:11
Draft of foocart
// Usage
const cart = new Cart({
priceTemplate: '{price} UAH',
completeOrder(order) {
return Promise.resolve({ success: true });
},
fetchTranslation(translation) {
return Promise.resolve({});
},
<button type="button" id="share">Share</button>
<canvas id="myCanvas"></canvas>
<script>
var canvas = document.getElementById('myCanvas'),
ctx = canvas.getContext('2d'),
image = new Image();
var file;
<button>
Click
</button>
@jmas
jmas / gist:d385ab9bdc05f8639a2a83a5193ebd25
Created April 27, 2020 11:25 — forked from sshay77/gist:4b1f6616a7afabc1ce2a
google-search-url-parameters-query-string-
// ==UserScript==
// @name Google Search Better Privacy
// @description Delete unnecessary params and add useful params on Google Search.
// @version 0.0.4
// @include http://*.google.*/search*
// @include http://*.google.*/imgres*
// @include https://*.google.*/search*
// @include https://*.google.*/imgres*
// @exclude http://play.google.com/*
// @exclude http://mail.google.com/*
<div class="section">
<div class="container" style="--background-color: {{ background_color }}">
<div class="slider" data-controller="slider">
{{# slides_list }}
{{ name_text }}
{{/ slides_list }}
</div>
</div>
</div>
@jmas
jmas / data.json
Created March 22, 2020 10:11
Snippet example
{
"title": "Welcome",
"options": {
"theme": "dark"
}
}
@jmas
jmas / base.css
Last active March 22, 2020 09:30
Infrastructure
body {
margin: 0;
font-family: sans-serif;
font-size: 16px;
}
.section {
position: relative;
align-content: center;
display: grid;
body { background: transparent !important; margin: 0px auto; overflow: hidden; }
.rooms-header.tw-align-items-center.tw-border-b.tw-c-background-base.tw-flex.tw-flex-shrink-0.tw-full-width.tw-justify-content-center.tw-pd-l-1.tw-pd-r-1,
.chat-input.tw-block.tw-pd-b-1.tw-pd-x-1 { display: none !important; }
.chat-room.tw-flex.tw-flex-column.tw-flex-grow-1.tw-flex-shrink-1.tw-full-width {
background: transparent !important;
}
body {
font-size: 200% !important;
font-weight: bold !important;
}
@jmas
jmas / square.js
Last active December 16, 2019 01:49
var square =
` +-+
|
+-+-+
| | -
+-+-+`;
var points = [];
var jumpers = [];
var relations = [];
square.split('\n').forEach((line, lineIndex) => {