Skip to content

Instantly share code, notes, and snippets.

View kururu-abdo's full-sized avatar
💻
coding

kururu kururu-abdo

💻
coding
View GitHub Profile
@kururu-abdo
kururu-abdo / gist:05e400561707c89be456f6f701905995
Created August 10, 2022 14:31 — forked from dodyg/gist:5616605
Kotlin Programming Language Cheat Sheet Part 2

This is a quick guide to Kotlin programming language. The previous part of this guide is here

#Object Oriented

fun main(args : Array<String>) {
  class local (val x : Int)
  
  val y = local(10)
 println("${y.x}")
@kururu-abdo
kururu-abdo / get-medium-stats.js
Created December 1, 2022 13:02 — forked from igeligel/get-medium-stats.js
medium-get-totals
const totalTypes = {
VIEWS: 2,
READS: 3,
FANS: 5
};
const getTotal = tableColumn =>
[
...document.querySelectorAll(
`td:nth-child(${tableColumn}) > span.sortableTable-number`
@kururu-abdo
kururu-abdo / Extensions.cs
Created March 21, 2024 20:27 — forked from karenpayneoregon/Extensions.cs
Working with strings and ternary operator
using System.Text.RegularExpressions;
public static class StringExtensions
{
// remove double spaces
public static string RemoveExtraSpaces(this string sender, bool trimEnd = false)
{
const RegexOptions options = RegexOptions.None;
var regex = new Regex("[ ]{2,}", options);
var result = regex.Replace(sender, " ");