A Pen by Leo Grachov on CodePen.
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
@Leo Grachov@ | |
Hello! I'm focused on *JavaScript* | |
development and love coding when | |
it's fun. |
This is a simple Bash script I made to toggle the screenshot shadow on Mac computers.
Bash 2 or later macOS Mojave 10.14.0 or later
To toggle, just run the script. If it says access denied, run this command:
# You must be in the folder where you downloaded the .sh file
$ chmod +x toggleScreenshotShadow.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
# fib.py | |
# Written by Lev Grachov | |
# Import Tkinter | |
# If you get module not installed, then run this command: | |
# For Linux: `sudo apt-get install python3-tk` | |
# For Windows: `pip install tk` | |
# For macOS: `brew install python-tk` | |
from tkinter.simpledialog import askinteger | |
from tkinter import * |
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
const selects = [ | |
{ | |
name: "Select 1", | |
options: ["Option 1", "Option 2"], | |
}, | |
{ | |
name: 'Select 2', | |
options: ['Option 1, 'Option 2'] | |
} | |
]; |
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
<!doctype html> | |
<html lang="en-GB"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<title>Document</title> | |
</head> | |
<body> | |
<!-- Add your code here --> | |
</body> |
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 numpy as np | |
import matplotlib.pyplot as plt | |
import matplotlib.animation as animation | |
# Set up the figure and axis | |
fig, ax = plt.subplots() | |
x = np.linspace(0, 2 * np.pi, 100) # X values from 0 to 2π | |
line, = ax.plot(x, np.sin(x)) # Initial sine wave | |
ax.set_ylim(-1.5, 1.5) # Set y-axis limits | |
ax.set_title('Sine wave animation') |
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
const randomItemFromList = (list) => { | |
/* Simple helper function to get a random item from a list. */ | |
return list[Math.floor(Math.random() * list.length)]; | |
}; |
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
function quickSort(arr) { | |
if (arr.length <= 1) return arr; | |
const pivot = arr[arr.length - 1]; | |
const left = arr.filter(el => el < pivot); | |
const right = arr.filter(el => el >= pivot).slice(0, -1); | |
return [...quickSort(left), pivot, ...quickSort(right)]; | |
} | |
/* Usage */ | |
const array = [3, 5, 6, 9, 8, 1, 2, 7, 4, 10]; |
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
node index.js > artifact.txt |
OlderNewer