Skip to content

Instantly share code, notes, and snippets.

@gitdagray
gitdagray / rps_v3.js
Created October 8, 2020 18:31
Rock_Paper_Scissors_v3
// Rock, Paper, Scissors: Refactored with Functions
const initGame = () => {
const startGame = confirm("Shall we play rock, paper, or scissors?");
startGame ? playGame() : alert("Ok, maybe next time.");
};
// Game flow function
const playGame = () => {
while (true) {
let playerChoice = getPlayerChoice();
@gitdagray
gitdagray / rps_v2.js
Created October 8, 2020 18:29
Rock_Paper_Scissors_v2
// Rock, Paper, Scissors: Refactored with While Loop and an Array
let playGame = confirm("Shall we play rock, paper, or scissors?");
if (playGame) {
//play
while (playGame) {
const playerChoice = prompt("Please enter rock, paper, or scissors.");
if (playerChoice || playerChoice === "") {
const playerOne = playerChoice.trim().toLowerCase();
if (
playerOne === "rock" ||
@gitdagray
gitdagray / rps_v1.js
Last active May 12, 2024 17:39
Rock_Paper_Scissors_v1
// Your First Interactive Game
let playGame = confirm("Shall we play rock, paper, or scissors?");
if (playGame) {
//play
let playerChoice = prompt("Please enter rock, paper, or scissors.");
if (playerChoice) {
let playerOne = playerChoice.trim().toLowerCase();
if (
playerOne === "rock" ||
playerOne === "paper" ||
@gitdagray
gitdagray / js_chapter_22_css.css
Created January 3, 2022 17:09
JS Course Chapter 22 CSS
* {
margin: 0;
padding: 0;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
html {
font-family: Arial, Helvetica, sans-serif;
font-size: 16px;
@emiremen
emiremen / CatchKenny.java
Last active May 12, 2024 17:37
Android Studio Catch Kenny oyunu
public class MainActivity extends AppCompatActivity {
ImageView myImg;
TextView textView, textView2;
int score;
int screenX, screenY;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@ngupta23
ngupta23 / online_learning_pycaret_sktime.ipynb
Created October 25, 2021 17:40
online_learning_pycaret_sktime.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@gitdagray
gitdagray / js_chapter_22_html.html
Created January 3, 2022 17:11
JS Chapter 22 HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>My Page</title>
<link rel="stylesheet" href="css/js_chapter_22_css.css" />
<script defer src="js/main.js"></script>
</head>
@gitdagray
gitdagray / index.html
Created November 21, 2021 23:17
HTML and CSS for Javascript DOM Tutorial
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>My Page</title>
<style>
* {
margin: 0;
padding: 0;
@ruvnet
ruvnet / *notepad.ipynb
Last active May 12, 2024 17:36
*metaprompt.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@berndbausch
berndbausch / LXD-cheat-sheet.md
Last active May 12, 2024 17:30
LXD cheat sheet

Useful LXD commands

Summarized from https://stgraber.org/2016/03/19/lxd-2-0-your-first-lxd-container-312/.

Interestingly, the LXD command line client is named.... lxc!

List available containers

lxc image list ubuntu:        # ubuntu: is officially supported image source
lxc image list images:        # images: is an unsupported source
lxc image alias list images:  # lists user-friendly names