Skip to content

Instantly share code, notes, and snippets.

View abd3lraouf's full-sized avatar
📸
Storyteller

Abdelraouf Sabri abd3lraouf

📸
Storyteller
View GitHub Profile
/**
* This method displays the given price on the screen.
*/
private void displayPrice(int number) {
TextView priceTextView = (TextView) findViewById(R.id.price_text_view);
priceTextView.setText(NumberFormat.getCurrencyInstance().format(number));
}
@abd3lraouf
abd3lraouf / 0_reuse_code.js
Created December 18, 2015 14:07
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@abd3lraouf
abd3lraouf / AlwaysRectangle.java
Created December 29, 2015 23:12
Always rectangle
package Junit;
import javafx.application.*;
import javafx.scene.*;
import javafx.scene.layout.*;
import javafx.scene.paint.*;
import javafx.scene.shape.*;
import javafx.stage.*;
public class AlwaysRectangle extends Application {
import javafx.application.*;
import javafx.event.*;
import javafx.scene.*;
import javafx.scene.input.*;
import javafx.stage.*;
public class BounceBallControl extends Application {
/**
* The main method is only needed for the IDE with limited
* JavaFX support. Not needed for running from the command line.
import javafx.application.*;
import javafx.event.*;
import javafx.scene.*;
import javafx.scene.input.*;
import javafx.stage.*;
public class BounceBallControl extends Application {
/**
* The main method is only needed for the IDE with limited
* JavaFX support. Not needed for running from the command line.
import javafx.application.*;
import javafx.event.*;
import javafx.scene.*;
import javafx.scene.input.*;
import javafx.stage.*;
public class BounceBallControl extends Application {
/**
* The main method is only needed for the IDE with limited
* JavaFX support. Not needed for running from the command line.
import javafx.animation.*;
import javafx.beans.property.*;
import javafx.scene.layout.*;
import javafx.scene.paint.*;
import javafx.scene.shape.*;
import javafx.util.*;
public class BallPane extends Pane {
public final double radius = 20;
private double x = radius, y = radius;
import javafx.animation.*;
import javafx.beans.property.*;
import javafx.scene.layout.*;
import javafx.scene.paint.*;
import javafx.scene.shape.*;
import javafx.util.*;
public class BallPane extends Pane {
public final double radius = 20;
private double x = radius, y = radius;
public static int parseInt(char[] charArray) {
int sum = 0;
for (char c : charArray) {
sum = (sum * 10) + (c - '0');
}
return sum;
}
[package]>java.util.*
Random
>Methods:
nextInt();
nextFloat(); // etc ...
GregorianCalendar
>Methods:
calendar.get(constant);
calendar.setTimeInMillis(long);
calendar.setTime(Date);