This file contains hidden or 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
#!/usr/bin/env python3 | |
""" | |
A puzzle game based on the Knight's Tour problem. | |
Requires Python 3.6+ and PyGame ($ pip3 install pygame) | |
Instructions: | |
* Left-click to move a knight's move away from the starting cell (highlighted blue) | |
* Right-click anywhere to undo |
This file contains hidden or 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
CREATE TABLE Test ( | |
id integer primary key autoincrement, | |
data text not null, | |
_last_updated datetime default current_timestamp | |
); | |
CREATE TRIGGER update_test_timestamp | |
AFTER UPDATE ON Test BEGIN | |
UPDATE Test SET _last_updated = datetime("now") WHERE id = new.id; | |
END; |
This file contains hidden or 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 discord | |
import chess | |
token = "It's a secret *wink wink*" | |
class ChessClient(discord.Client): | |
def __init__(self): | |
super().__init__() | |
self.chess_board = None | |
self.players = None |
This file contains hidden or 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge" /> | |
<title>Document</title> | |
<link | |
rel="stylesheet" | |
href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" |
This file contains hidden or 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 React from "react"; | |
import "./App.css"; | |
function App() { | |
const [current, setCurrent] = React.useState(1); | |
const options = [1, 2, 3]; | |
const handleChange = e => { | |
console.log(e.target); | |
setCurrent(parseInt(e.target.value)); |