Skip to content

Instantly share code, notes, and snippets.

:octocat:
Nyunmor

Ramadani ramadani

:octocat:
Nyunmor
Block or report user

Report or block ramadani

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ramadani
ramadani / initialname.js
Last active Nov 6, 2018
Create initial name with javascript
View initialname.js
function initialName(name, length) {
const parts = name.split(' ');
return parts.filter((it, i) => i <= (length - 1)).map(it => it.substring(0, 1)).join('');
},
@ramadani
ramadani / circle_test.go
Created Jul 16, 2018
Full Circle Test Code
View circle_test.go
package circle
import (
"testing"
)
func TestDiameter(t *testing.T) {
circle := Circle{Radius: 7}
expected := 14.0
@ramadani
ramadani / circle_test.go
Created Jul 16, 2018
Snippet from Circle Test Code
View circle_test.go
package circle
import (
"testing"
)
func TestArea(t *testing.T) {
circle := Circle{Radius: 10}
expected := 314.1592653589793
@ramadani
ramadani / circle.go
Created Jul 16, 2018
Circle Package Example with Go
View circle.go
package circle
import (
"math"
)
type Circle struct {
Radius float64
}
View NotePresenter.java
public void create(String title, String content) {
String key = mNoteRef.push().getKey();
Note note = new Note(key, title, content);
mNoteRef.child(key).setValue(note);
}
@ramadani
ramadani / NotesPresenter.java
Last active Apr 9, 2017
Simple Android App using Firebase Realtime Database - ValueEventListener
View NotesPresenter.java
ValueEventListener valueEventListener = new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
ArrayList<Note> notes = new ArrayList<Note>();
for (DataSnapshot noteSnapshot: dataSnapshot.getChildren()) {
Note note = noteSnapshot.getValue(Note.class);
notes.add(note);
}
@ramadani
ramadani / Note.java
Last active Apr 8, 2017
Simple Android App using Firebase Realtime Database - Java Object
View Note.java
@IgnoreExtraProperties
public class Note {
private String uid;
private String title;
private String content;
public Note() {
}
@ramadani
ramadani / javan_case_study13.java
Created Apr 7, 2017
Javan Array Study Case 13
View javan_case_study13.java
public void case13() {
ArrayList<User> users = new ArrayList<User>();
users.add(new User(1, "Adimas Lutfi Wicaksono"));
users.add(new User(2, "Salman Alfarisi"));
users.add(new User(3, "Muhammad Sholeh"));
ArrayList<User> usersDeleted = new ArrayList<User>();
usersDeleted.add(new User(2, "Salman Alfarisi"));
usersDeleted.add(new User(3, "Muhammad Sholeh"));
@ramadani
ramadani / javan_case_study12.java
Created Apr 7, 2017
Javan Array Study Case 12
View javan_case_study12.java
public void case12() {
ArrayList<User> users = new ArrayList<User>();
users.add(new User(1, "Adimas Lutfi Wicaksono", 1));
users.add(new User(2, "Salman Alfarisi", 1));
users.add(new User(3, "Muhammad Sholeh", 1));
users.add(new User(4, "Yadi Cahyadi", 1));
users.add(new User(5, "Maya Maulani", 2));
}
private class User {
@ramadani
ramadani / javan_case_study14.java
Created Apr 7, 2017
Javan Array Study Case 14
View javan_case_study14.java
public void case14() {
ArrayList<User> users = new ArrayList<User>();
users.add(new User(1, "Adimas Lutfi Wicaksono"));
users.add(new User(2, "Salman Alfarisi"));
users.add(new User(3, "Muhammad Sholeh"));
ArrayList<User> usersNew = new ArrayList<User>();
usersNew.add(new User(4, "Yadi Cahyadi"));
usersNew.add(new User(5, "Maya Maulani"));
You can’t perform that action at this time.