Skip to content

Instantly share code, notes, and snippets.

View yogithesymbian's full-sized avatar
✔️
scodeid - open source code id

Yogi Arif Widodo yogithesymbian

✔️
scodeid - open source code id
View GitHub Profile
@brandonchadlange
brandonchadlange / crud-service-interface
Created October 10, 2022 20:55
A simple interface for defining CRUD services
export interface ICrudService<T> {
getAll: () => Promise<T[]>;
getOne: (id: string) => Promise<T | null>;
create: (data: T) => Promise<T>;
update: (id: string, data: T) => Promise<T>;
delete: (id: string) => Promise<T>;
}
@brandonchadlange
brandonchadlange / todos.tsx
Created October 3, 2022 20:54
Todos full implementation
interface Todo {
description: string;
complete: boolean;
}
const useTodoListViewModel = () => {
const [todos, setTodos] = useState<Todo[]>([]);
const createTodo = (description: string) => {
const newTodo: Todo = {
// https://github.com/yogithesymbian/Kotlin-Setup-Starterpackjelly-2021
// model viemodel viewmodelfacotry interface livedata
// soon will publish
// (File Header.java)
/**
* Android Studio Arctic Fox | 2020.3.1 Patch 3
* Build #AI-203.7717.56.2031.7784292, built on October 1, 2021
* Runtime version: 11.0.10+0-b96-7281165 x86_64
* VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
* macOS 11.6
class FragmentViewBindingProperty<T : ViewBinding>(
private val viewBinder: ViewBinder<T>
) : ReadOnlyProperty<Fragment, T> {
private var viewBinding: T? = null
private val lifecycleObserver = BindingLifecycleObserver()
@MainThread
override fun getValue(thisRef: Fragment, property: KProperty<*>): T {
checkIsMainThread()
# this file contains keys needed for decryption of file system data (WUD/WUX)
# 1 key per line, any text after a '#' character is considered a comment
# the emulator will automatically pick the right key
541b9889519b27d363cd21604b97c67a # example key (can be deleted)
d7b00402659ba2abd2cb0db27fa2b656 # Common
805e6285cd487de0faffaa65a6985e17 # Espresso Ancast
b5d8ab06ed7f6cfc529f2ce1b4ea32fd # Starbuck Ancast
9a164ee15ac7ceb64d3cc130094095f6 # 007 Legends [EUR, NUS]
@angelabauer
angelabauer / scratch.dart
Created April 6, 2019 15:50
Starting Code for Futures/Async/Await Demo
import 'dart:io';
void main() {
performTasks();
}
void performTasks() {
task1();
task2();
task3();
@VesperDev
VesperDev / RouterApp.js
Last active July 14, 2024 11:50
Sider menu + ant-design + react-router-dom
import React, { Component } from 'react';
import { BrowserRouter as Router, Route, Link } from "react-router-dom";
import { Layout, Menu, Icon } from 'antd';
import Dashboard from './containers/Dashboard/Dashboard';
import Meseros from './containers/Meseros/Meseros';
const { Header, Content, Footer, Sider } = Layout;
const SubMenu = Menu.SubMenu;
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active July 22, 2024 06:03
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@mvneves
mvneves / ssh-agent.md
Last active June 12, 2024 10:33
"Could not open a connection to your authentication agent"

SSH authentication agent does not automatically start when using it from a remote server. This results in the following error message:

$ git pull
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
$ ssh-add ~/my-ssh-key.pem
Could not open a connection to your authentication agent.

To fix it requires manually starting ssh-agent: