Skip to content

Instantly share code, notes, and snippets.

View wjes's full-sized avatar

Warren Eaton wjes

View GitHub Profile
import {DocumentNode} from "@apollo/client";
import {print} from "graphql/language/printer";
export async function getDataFromGql(gqlData: DocumentNode, variables: any = undefined) {
const data = await fetch("https://graphql.svcc.mobi/graphql", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
@headquarters
headquarters / bastion-host.sh
Created January 6, 2020 18:00
SSH Tunnel to MySQL via Bastion Host
#!/bin/bash
# The following environment variables are required for connecting to the DB via an SSH tunnel:
# DBHOST -> the MySQL DB endpoint
# BASTIONUSER -> username for connecting to the bastion host, associated with your SSH key
# BASTIONHOST -> the IP or hostname of the bastion host
#
# Overriding the SSH key path is optional:
# SSHKEYPATH -> if using a non-default SSH key, set this to override ~/.ssh/id_rsa
@jatcwang
jatcwang / gist:ae3b7019f219b8cdc6798329108c9aee
Created February 2, 2017 23:44
List of all setxkbmap configuration options (including models/layout/etc)
! model
pc101 Generic 101-key PC
pc102 Generic 102-key (Intl) PC
pc104 Generic 104-key PC
pc105 Generic 105-key (Intl) PC
dell101 Dell 101-key PC
latitude Dell Latitude series laptop
dellm65 Dell Precision M65
everex Everex STEPnote
flexpro Keytronic FlexPro
@kevinweber
kevinweber / encodeSvg.js
Created October 31, 2016 05:36
Helper: Convert React component (SVG element) to base64 encoded URL. Useful for adding a background image.
import ReactDOMServer from 'react-dom/server';
export function encodeSvg(reactElement) {
return 'data:image/svg+xml,' + escape(ReactDOMServer.renderToStaticMarkup((reactElement)));
}
@tofirius
tofirius / mysql-dump-tables-by-prefix.txt
Last active January 16, 2023 19:56
MySQL dump of tables that begin with a given prefix
mysql database_name -u username -pPassWord -N -e 'show tables like "tableprefix\_%"' | xargs mysqldump database_name -u username -pPassWord > prefixedtable_dump.sql
@ertseyhan
ertseyhan / remount.sh
Created February 2, 2016 20:51
Temporarily increase size of tmp folder on Arch linux
#!/bin/bash
sudo mount -o remount,size=10G,noatime /tmp
echo "Done. Please use 'df -h' to make sure folder size is increased."
@OlegIlyenko
OlegIlyenko / Event-stream based GraphQL subscriptions.md
Last active May 16, 2024 02:05
Event-stream based GraphQL subscriptions for real-time updates

In this gist I would like to describe an idea for GraphQL subscriptions. It was inspired by conversations about subscriptions in the GraphQL slack channel and different GH issues, like #89 and #411.

Conceptual Model

At the moment GraphQL allows 2 types of queries:

  • query
  • mutation

Reference implementation also adds the third type: subscription. It does not have any semantics yet, so here I would like to propose one possible semantics interpretation and the reasoning behind it.

@Phaeilo
Phaeilo / archvm.sh
Last active May 24, 2022 19:55
Archlinux VM automated installation script.
#!/bin/bash
# The MIT License (MIT)
#
# Copyright (c) 2015 Philip Huppert
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, including without limitation the rights to
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
@developius
developius / README.md
Last active April 25, 2024 22:15
Setup SSH keys for use with GitHub/GitLab/BitBucket etc

Create a new repository, or reuse an existing one.

Generate a new SSH key:

ssh-keygen -t rsa -C "your_email@example.com"

Copy the contents of the file ~/.ssh/id_rsa.pub to your SSH keys in your GitHub account settings (https://github.com/settings/keys).

Test SSH key: