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
def parse_midi_file_to_simplified_notes(midi_file_path): | |
class SimplifiedNote: | |
def __init__(self, pitch, duration=-1): | |
notes_names = ['C', 'C#', 'D', 'D#', 'E', 'F', 'F#', 'G', 'G#', 'A', 'A#', 'B'] | |
self.pitch = pitch | |
self.duration = duration | |
self.name = notes_names[pitch % 12] | |
self.depth = pitch // 12 |
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
package lucasalfare.sudoku | |
enum class State { | |
Hidden, Empty, PreSolved, Filled | |
} | |
data class Cell( | |
var number: Int, var state: State = State.Empty | |
) |
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
enum class TokenType { | |
UNR, | |
OPR, | |
NUM, | |
PAR | |
} | |
class Token(val type: TokenType, val value: String) { | |
override fun toString() = "{ type=$type, value=$value }" | |
} |
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
from tkinter import * | |
import random | |
class Repeater: | |
def __init__(self): | |
self.isRunning = True | |
self.callback = None | |
import threading |
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 time | |
import keyboard | |
ONE_MILLISECOND = 1 / 1000 | |
def currentTime(): | |
return round(time.time() * 1000) |
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
# This .gitignore file should be placed at the root of your Unity project directory | |
# | |
# Get latest from https://github.com/github/gitignore/blob/main/Unity.gitignore | |
# | |
/[Ll]ibrary/ | |
/[Tt]emp/ | |
/[Oo]bj/ | |
/[Bb]uild/ | |
/[Bb]uilds/ | |
/[Ll]ogs/ |
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
tasks.withType<Jar> { | |
duplicatesStrategy = DuplicatesStrategy.EXCLUDE | |
manifest { | |
attributes["Main-Class"] = "hehe.MainKt" | |
} | |
from(sourceSets.main.get().output) | |
dependsOn(configurations.runtimeClasspath) |
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 { useEffect, useState } from "react"; | |
import ComponentManager from "./ComponentManager.js"; | |
//this instance can "emit" events for any observable/listenable | |
const manager = new ComponentManager(); | |
//The react component | |
function Timer() { | |
const [time, setTime] = useState("ready"); |
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 { useEffect, useState, useRef } from "react"; | |
/** Basic function to add trailing characters in front a other value in a specified count. */ | |
function padStart(value, count, character) { | |
let str = `${value}`; | |
if (str.length < count) { | |
for (let i = 0; i < count - str.length + 1; i++) { | |
str = `${character}${str}`; | |
} | |
} |
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"> | |
<title>Contagem regressiva para o plantão acabar</title> | |
<div class="panel"> | |
<h1 id="display" class='display'>carregando...</h1> |