Skip to content

Instantly share code, notes, and snippets.

View graphql.js
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 Oct 13, 2020
Draft of foocart
View draft.ts
// Usage
const cart = new Cart({
priceTemplate: '{price} UAH',
completeOrder(order) {
return Promise.resolve({ success: true });
},
fetchTranslation(translation) {
return Promise.resolve({});
},
View index.html
<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;
View index.html
<button>
Click
</button>
@jmas
jmas / gist:d385ab9bdc05f8639a2a83a5193ebd25
Created Apr 27, 2020 — forked from sshay77/gist:4b1f6616a7afabc1ce2a
google-search-url-parameters-query-string-
View gist:d385ab9bdc05f8639a2a83a5193ebd25
// ==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/*
View gist:0727895fda999c51ec668bd401b40ad3
<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 Mar 22, 2020
Snippet example
View data.json
{
"title": "Welcome",
"options": {
"theme": "dark"
}
}
@jmas
jmas / base.css
Last active Mar 22, 2020
Infrastructure
View base.css
body {
margin: 0;
font-family: sans-serif;
font-size: 16px;
}
.section {
position: relative;
align-content: center;
display: grid;
View obs-twitch-chat.css
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;
}
View square.js
var square =
` +-+
|
+-+-+
| | -
+-+-+`;
var points = [];
var jumpers = [];
var relations = [];
square.split('\n').forEach((line, lineIndex) => {