Skip to content

Instantly share code, notes, and snippets.

import javax.swing.*;
public class HelloWorldSwing {
/**
* Create the GUI and show it. For thread safety,
* this method should be invoked from the
* event-dispatching thread.
*/
private static void createAndShowGUI() {
//Create and set up the window.
import javax.swing.*;
public class HelloWorldSwing {
/**
* Create the GUI and show it. For thread safety,
* this method should be invoked from the
* event-dispatching thread.
*/
private static void createAndShowGUI() {
//Create and set up the window.
from tkinter import *
window = Tk()
window.title("Welcome to LikeGeeks app")
lbl = Label(window, text="Hello")
lbl.grid(column=0, row=0)
type VectorAng2 = {
mag: number,
dir: number,
dim: 2
}
@AlienKevin
AlienKevin / addSimultaneousEventListeners.js
Created April 9, 2019 21:02
Add same event listener to multiple simultaneous events that are fired at about the same time.
function addSimultaneousEventListeners(eventNames, callback, options) {
const defaultOptions = {
inOrder: true, // the events should be fired in the order specified in eventNames array or not
tolerance: 500, // the tolerance time between the first and the last event in milliseconds,
// you can rarely fire two events at the exact moment
}
// merge default options with user options
const mergedOptions = {
...defaultOptions,
...options