Skip to content

Instantly share code, notes, and snippets.

View tatocaster's full-sized avatar
🇺🇦

Merab Tato Kutalia tatocaster

🇺🇦
View GitHub Profile
@tatocaster
tatocaster / nintendo.ts
Created August 15, 2023 09:04
get Nintendo EShop games and metacritics score
import { getGamesAmerica, GameUS, EshopError } from 'nintendo-switch-eshop';
import * as fs from 'fs';
import { HTMLElement, parse } from "node-html-parser";
import fetch from 'node-fetch';
const dest = './nintendo-games.json';
const allowedLettersInTitle = /[^a-zA-Z0-9 ]+/g;
const PAGE_SIZE = 25
@tatocaster
tatocaster / recommendation.py
Last active August 15, 2023 09:20
based on Nintendo game data, cluster by features and get similar games
import pandas as pd
from sklearn.cluster import KMeans
# Read the video games dataset into a DataFrame
data = pd.read_json('../data/nintendo-games.json')
features = data[['meta_score', 'esrb_rating', 'genres']]
# convert categorical features to numerical using one-hot encoding
features = pd.get_dummies(features, columns=['meta_score', 'esrb_rating', 'genres'])
@tatocaster
tatocaster / nintendo.go
Last active August 15, 2023 08:09
Download Nintendo Game data for my account
package main
import (
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"os"
"regexp"
"os/exec"
@tatocaster
tatocaster / quick_approve.js
Created September 30, 2022 07:08 — forked from lamp/quick_approve.js
Mark All Issues on codeclimate as wontfix
$('li[data-issue-status-name="wontfix"]').each((i, e) => { e.click() })
$('input[name="commit"]').each((i, e) => { e.click() })
invoke-static {p0}, Landroidx/preference/e;->a(Landroid/content/Context;)Landroid/content/SharedPreferences;
move-result-object v0
const-string v1, "preferencePremium"
const/4 v2, 0x1
invoke-interface {v0}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;
move-result-object v0
invoke-interface {v0, v1, v2}, Landroid/content/SharedPreferences$Editor;->putBoolean(Ljava/lang/String;Z)Landroid/content/SharedPreferences$Editor;
invoke-interface {v0}, Landroid/content/SharedPreferences$Editor;->apply()V
@tatocaster
tatocaster / dependencies.txt
Last active October 5, 2021 21:02
gradle dependencies. Snippet
+--- androidx.databinding:viewbinding:4.1.2
| \--- androidx.annotation:annotation:1.0.0 -> 1.2.0
+--- org.jetbrains.kotlin:kotlin-stdlib:1.4.32
| +--- org.jetbrains.kotlin:kotlin-stdlib-common:1.4.32
| \--- org.jetbrains:annotations:13.0
+--- com.squareup.leakcanary:leakcanary-android:2.7
| +--- com.squareup.leakcanary:leakcanary-android-core:2.7
| | +--- com.squareup.leakcanary:shark-android:2.7
| | | \--- com.squareup.leakcanary:shark:2.7
| | | \--- com.squareup.leakcanary:shark-graph:2.7
@tatocaster
tatocaster / detekt.gradle
Created February 25, 2021 15:09
Detekt gradle tasks for multi-module project
// add classpath dependency before
// classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:$detektVersion"
def configFile = files("$rootDir/config/detekt/detekt.yml")
def baselineFile = file("$rootDir/config/detekt/baseline.xml")
def analysisDir = file(projectDir)
def kotlinFiles = "**/*.kt"
def javaFiles = "**/*.java"
def resourceFiles = "**/resources/**"
@tatocaster
tatocaster / EspressoTest.kt
Last active August 9, 2020 20:02
Espresso Test
@Test
fun labelsAreDisplyed_SameFragment() {
// some other assertions
onView(withId(R.id.tvAccountNumberLabel))
.perform(nestedScrollTo())
.check(matches(isDisplayed()))
// here as well
}
@tatocaster
tatocaster / EspressoNestedScroll.kt
Created August 9, 2020 19:58
Nested Scroll View Espresso scroll viewaction
fun nestedScrollTo(): ViewAction {
return object : ViewAction {
override fun getConstraints(): Matcher<View> {
return CoreMatchers.allOf(ViewMatchers.withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE),
ViewMatchers.isDescendantOfA(CoreMatchers.anyOf(
ViewMatchers.isAssignableFrom(ScrollView::class.java),
ViewMatchers.isAssignableFrom(HorizontalScrollView::class.java),
ViewMatchers.isAssignableFrom(NestedScrollView::class.java)))
)
}
@tatocaster
tatocaster / main.go
Created June 17, 2020 20:41
full script for Slack and Garmin integration
package main
import (
"encoding/json"
"fmt"
"github.com/slack-go/slack"
"golang.org/x/net/context"
"golang.org/x/oauth2"
"golang.org/x/oauth2/google"
"google.golang.org/api/gmail/v1"