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 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 |
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
type VectorAng2 = { | |
mag: number, | |
dir: number, | |
dim: 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
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. |
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
from tkinter import * | |
window = Tk() | |
window.title("Welcome to LikeGeeks app") | |
lbl = Label(window, text="Hello") | |
lbl.grid(column=0, row=0) |
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 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. |
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
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" > | |
<TextView | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:layout_centerHorizontal="true" | |
android:layout_centerVertical="true" |
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
package com.example.helloworld; | |
import android.support.v7.app.AppCompatActivity; | |
import android.os.Bundle; | |
public class MainActivity extends AppCompatActivity { | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); |
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> | |
<head> | |
<title>First Web Page</title> | |
</head> | |
<body> | |
<p>Hello World!</p> | |
</body> | |
</html> |
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
module Main exposing (main) | |
import Browser | |
import Html exposing (Html, button, div, h2, text) | |
import Html.Events exposing (onClick) | |
import Dict exposing (Dict) | |
import Set exposing (Set) | |
type alias Model = |
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
onClickNoProp : Msg -> Html.Attribute Msg | |
onClickNoProp msg = | |
Html.Events.custom "click" | |
(Decode.succeed | |
{ message = msg | |
, stopPropagation = True | |
, preventDefault = False | |
} | |
) |
OlderNewer