View next-ssr-recoil.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {useEffect} from 'react' | |
import {RecoilRoot, useRecoilState, atom} from 'recoil' | |
// User data | |
const user1 = {username: 'joe', bio: "You will never see me, unless of course this example is totally broken."} | |
const user2 = {username: 'bob', bio: "I am the one true user."} | |
const user3 = {username: 'fred', bio: "Just kidding, make way for the new guy."} | |
// Recoil atom to store user. The default user is user1, but it will be |
View next-ssr-recoil-effects.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {useEffect, useMemo} from 'react' | |
import {RecoilRoot, useRecoilState, atom} from 'recoil' | |
// User data | |
const user1 = {username: 'joe', bio: "You will never see me, unless of course this example is totally broken."} | |
const user2 = {username: 'bob', bio: "I am the one true user."} | |
const user3 = {username: 'fred', bio: "Just kidding, make way for the new guy."} | |
// A potentially dangerous mutable global variable for initial state. The main |
View pytorch-conv1d-rnn.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import torch | |
from torch import nn | |
from torch.autograd import Variable | |
import torch.nn.functional as F | |
class RNN(nn.Module): | |
def __init__(self, input_size, hidden_size, output_size, n_layers=1): | |
super(RNN, self).__init__() | |
self.input_size = input_size | |
self.hidden_size = hidden_size |
View pytorch-simple-rnn.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import torch | |
import torch.nn as nn | |
from torch.nn import functional as F | |
from torch.autograd import Variable | |
from torch import optim | |
import numpy as np | |
import math, random | |
# Generating a noisy multi-sin wave |
View next-recoil-effects.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {useEffect} from 'react' | |
import {RecoilRoot, useRecoilState, atom} from 'recoil' | |
// User data | |
const user1 = {username: 'joe', bio: "You will never see me, unless of course this example is totally broken."} | |
const user2 = {username: 'bob', bio: "I am the one true user."} | |
const user3 = {username: 'fred', bio: "Just kidding, make way for the new guy."} | |
// Recoil atom to store user. The default user is user1, but it will be |
View ctrl-esc-karabiner.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"title": "Control_L to Esc when tapped", | |
"rules": [ | |
{ | |
"description": "Control_L to Esc when tapped, Control when held.", | |
"manipulators": [ | |
{ | |
"type": "basic", | |
"from": { | |
"key_code": "left_control", |
View esp-example-Makefile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PORT=/dev/cu.usbserial-AL00FP1H | |
LUAS=name.lc helpers.lc sta.lc blink.lc tcpclient.lc ir.lc | |
all: name init $(LUAS) | |
init: | |
nodemcu-tool -p $(PORT) upload init.lua | |
name: | |
@[ "${DEVICE_NAME}" ] || ( echo ">> DEVICE_NAME is not set"; exit 1 ) |
View grande-model.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class User(Model): | |
name: str | |
email: str | |
@to_one | |
def best_friend(self) -> User: pass | |
@to_many | |
def following(self) -> List[User]: pass |
View install-docker-18.09.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo | |
sudo yum install -y http://mirror.centos.org/centos/7/extras/x86_64/Packages/container-selinux-2.68-1.el7.noarch.rpm | |
sudo yum install -y docker-ce-18.09.5 containerd.io-1.2.2 | |
sudo usermod -a -G docker ec2-user | |
sudo systemctl start docker |
View build-countries-json.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'countries' | |
require 'json' | |
ISO3166.configure do |config| | |
config.locales = [:en, :cs, :de, :es, :fr, :ja, :nl, :sk] | |
end | |
# { | |
# AF: { | |
# name: { |
NewerOlder