Skip to content

Instantly share code, notes, and snippets.

// app/javascript/controllers/debounce_controller.js
import { Controller } from "@hotwired/stimulus"
export default class extends Controller {
static targets = [ "form" ]
connect() { console.log("debounce controller connected") }
search() {
clearTimeout(this.timeout)
@laptopmutia
laptopmutia / gemfile.lock
Last active August 13, 2022 03:05
gemfile changelog before bug
GIT
remote: https://github.com/prawnpdf/prawn.git
revision: 7d4f6b8998e0627259c1036a2cd6bca65cd53f45
specs:
prawn (2.4.0)
matrix (~> 0.4)
pdf-core (~> 0.9.0)
ttfunk (~> 1.7)
GEM
@laptopmutia
laptopmutia / contract_detail_cubit.dart
Created April 19, 2021 00:13
Anyone know why ContractTaskDetailPage not rerendered?
import 'package:anya/models/contracts/contract.dart';
import 'package:anya/repository/anya_repository.dart';
import 'package:bloc/bloc.dart';
import 'package:equatable/equatable.dart';
import 'package:meta/meta.dart';
part 'contract_detail_state.dart';
class ContractDetailCubit extends Cubit<ContractDetailState> {
ContractDetailCubit({
@laptopmutia
laptopmutia / 1.authentication_bloc.dart
Last active January 7, 2021 17:06
I'm trying to refactor bloc into cubit
import 'dart:async';
import 'package:authentication_repository/authentication_repository.dart';
import 'package:bloc/bloc.dart';
import 'package:equatable/equatable.dart';
import 'package:meta/meta.dart';
import 'package:pedantic/pedantic.dart';
part 'authentication_event.dart';
part 'authentication_state.dart';
@laptopmutia
laptopmutia / formik.tsx
Created January 21, 2019 15:20
how to refactor
<Mutation mutation={SIGN_IN_MUTATION}>
{(signIn) => (
<Formik
onSubmit={(values, FormikActions) => {
signIn({
variables: values
});
FormikActions.setSubmitting(false);
}}
render={form}
@laptopmutia
laptopmutia / LoginForm.tsx
Last active January 19, 2019 12:39
formik simple form but the lane is too much
import React, { Fragment, FunctionComponent } from "react";
import {
Formik,
Form,
Field,
ErrorMessage,
FormikProps,
FormikErrors,
FormikActions,
FieldProps
@laptopmutia
laptopmutia / android.vocab
Created November 9, 2018 10:28
vocab file
, btn btn-dashboard btn-home btn-notifications btn-search check footer label radio row slider stack switch { }
@laptopmutia
laptopmutia / 100.json
Created October 12, 2018 18:42
100.json
{
"images": [{
"sentids": [0, 1, 2, 3, 4],
"imgid": 0,
"sentences": [{
"tokens": ["a", "black", "dog", "is", "running", "after", "a", "white", "dog", "in", "the", "snow"],
"raw": "A black dog is running after a white dog in the snow .",
"imgid": 0,
"sentid": 0
}, {
@laptopmutia
laptopmutia / bootstrap.vocab
Created October 3, 2018 08:59
bootstrap.vocab
, { } small-title text quadruple row btn-inactive btn-orange btn-green btn-red double header btn-active single