Skip to content

Instantly share code, notes, and snippets.

View alzearafat's full-sized avatar

Alzea Arafat alzearafat

View GitHub Profile
@alzearafat
alzearafat / kotlinOOP.kt
Last active September 24, 2017 03:32
Kotlin Simple OOP
open class Player(val name: String, val age: String, val gender: String) { // Open means, this Class can be inherited to antother Class
open fun attack() {
println("Player can Attack!")
}
open fun defend() {
println("Player can defend also!")
}
@alzearafat
alzearafat / gist:4af3290d7e22392c10ad4ec4bebae2bd
Created September 21, 2017 11:33 — forked from dodyg/gist:5823184
Kotlin Programming Language Cheat Sheet Part 1

#Intro

Kotlin is a new programming language for the JVM. It produces Java bytecode, supports Android and generates JavaScript. The latest version of the language is Kotlin M5.3

Kotlin project website is at kotlin.jetbrains.org.

All the codes here can be copied and run on Kotlin online editor.

Let's get started.

@alzearafat
alzearafat / black-tinted-background.css
Last active September 29, 2017 07:26
black-tinted-background.css
.ys-about-img {
background: linear-gradient(to bottom, rgba(0, 10, 0, 0.5) 0%, rgba(0, 10, 0, 0.5) 100%), url('../img/about.jpg') no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
width: 100%;
height: 70vh;
}
@alzearafat
alzearafat / settings.json
Last active August 10, 2019 03:21
VS Code setting to hide certain extention from sidebar
// Place your settings in this file to overwrite the default settings
{
"files.exclude": {
"**/*.pyc": true,
"**/*.map": true,
"**/*__pycache__": true,
},
"editor.fontFamily": "Source Code Pro Medium",
"editor.fontSize": 14,
"editor.lineHeight": 19,
@alzearafat
alzearafat / Elixir_Pattern_Matching_In_Func.exs
Last active November 2, 2016 09:57
Elixir Pattern Matching In Function Definitions
defmodule Talker do
def say_hello(:bob) do
IO.puts "Hello Bob!"
end
def say_hello(:jane) do
IO.puts "Hello Jane!"
end
def say_hello(name) do
@alzearafat
alzearafat / C#_Properties_In_One_File.cs
Created October 30, 2016 11:49
C# Properties {get & set} in One File
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FirstConsoleProject
{
class Player
{
@alzearafat
alzearafat / C#_Enum_in_One_File.cs
Created October 30, 2016 09:12
C# Enumeration in one file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FirstConsoleProject
{
//THIS IS ENUMERATION
@alzearafat
alzearafat / C#_Inheritance_in_One_File.cs
Created October 29, 2016 18:42
C# inheritance (one of the three pillars of OOP) in one file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FirstConsoleProject
{
//THIS IS BASE CLASS
class Animal
@alzearafat
alzearafat / another_c#_oop_calculator.cs
Created October 28, 2016 03:58
Just for practice (C# OOP Calc)
using System;
namespace latihan
{
class Kalkulator{
public string Tambah="+";
public string Kurang="-";
public string Kali="*";
public string Bagi="/";
public string CalcOp;
@alzearafat
alzearafat / C#_OOP_in_One_File.cs
Last active October 26, 2016 17:39
Basic C# OOP concept in one file.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FirstConsoleProject
{
class Animal
{