Skip to content

Instantly share code, notes, and snippets.

View jackvial's full-sized avatar

Jack Vial jackvial

View GitHub Profile
# I was running spectaql to generate documentation for my GraphQL API and it complained about
# directives that I had in my schema file. I threw errors including
# - Unknown directive "@model".
# - Unknown directive "@auth".
# - Unknown directive "@index".
# - Unknown directive "@hasOne".
# These are all directives you would use when developing an Amplify app.
#
# Created this file to include as the first schemaFile in specaql.yml so that the graphql
# parser is aware of the directives and can simply ignore them.
@efirdc
efirdc / pytorch_connected_components.py
Created June 8, 2020 01:37
Connected components in pytorch
# Demonstration: https://www.youtube.com/watch?v=5AvHrIK-Kjc&feature=youtu.be
# rand_cmap from https://stackoverflow.com/questions/14720331/how-to-generate-random-colors-in-matplotlib
import matplotlib.pyplot as plt
import torch
import torch.nn.functional as F
from visualizations import rand_cmap
W = H = 64
img = torch.randn(W, H).to(device)

Ubuntu 22.04 for Deep Learning

In the name of God

This gist contains steps to setup Ubuntu 22.04 for deep learning.


Install Ubuntu 22.04

@glebec
glebec / lambda-talk-qa.md
Created October 18, 2019 17:27
Smartly.io DevTalks - Lambda Calculus post-talk Q&A

Lambda Calculus Q&A

These are my responses to some of the questions asked at the end of my Lambda Calculus talk, held on 2019-10-15 at Smartly.io's DevTalks in Helsinki. I've grouped similar questions together.

Books and Resources

  • What's the one encompassing book you would recommend to read on this very interesting topic?
  • Can you recommend a book (or books) that cover some of the history you shared in more detail?
  • So what IS the book to read to get into understanding all of this?

Remote Jupyter Notebook

$laptop: ssh -l <username>@<yourNewServerIP>
$server: jupyter notebook --no-browser --port=8888
$laptop: ssh -NL 8888:localhost:8888 <username>@<yourNewServerIP>

Then you can goto http://localhost:8888 on your laptop’s browser and remotely view/edit your Jupyter notebooks.

@hagemann
hagemann / database.js
Last active December 9, 2022 10:24
Promisified MySQL middleware for Node.js
const util = require('util')
const mysql = require('mysql')
const pool = mysql.createPool({
connectionLimit: 10,
host: 'localhost',
user: 'root',
password: 'password',
database: 'my_database'
})
@jackvial
jackvial / postgres-setup.md
Last active November 10, 2022 21:25
Laravel Postgres Setup

Postgres Setup

Step 1: Install PostgreSQL

Here are the installation steps on Ubuntu (this installation will also work on any Debian-based distribution):

  1. Open a terminal window.
  2. Issue the command sudo apt-get install postgresql.
  3. Type the sudo password necessary to give you admin rights and hit Enter.
  4. Allow apt to pick up any necessary dependencies.
@LyleScott
LyleScott / rotate_2d_point.py
Last active May 27, 2024 13:34
Rotate X,Y (2D) coordinates around a point or origin in Python
"""
Lyle Scott, III // lyle@ls3.io
Multiple ways to rotate a 2D point around the origin / a point.
Timer benchmark results @ https://gist.github.com/LyleScott/d17e9d314fbe6fc29767d8c5c029c362
"""
from __future__ import print_function
import math
@ammarshah
ammarshah / all_email_provider_domains.txt
Last active July 15, 2024 20:13
A list of all email provider domains (free, paid, blacklist etc). Some of these are probably not around anymore. I've combined a dozen lists from around the web. Current "major providers" should all be in here as of the date this is created.
0-mail.com
007addict.com
020.co.uk
027168.com
0815.ru
0815.su
0clickemail.com
0sg.net
0wnd.net
0wnd.org