Skip to content

Instantly share code, notes, and snippets.

View pishguy's full-sized avatar

Mahdi Pishguy pishguy

View GitHub Profile
* Copyright (C) 2014
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Unless required by applicable law or agreed to in writing, software
pishguy /
Created September 21, 2017 08:16 — forked from pratamawijaya/
Android Endless Scroll using RecyclerView
public class EndlessListActivity<D> extends Activity {
private EndlessRecyclerOnScrollListener mEndlessScrollListener;
private EndlessListAdapter mAdapter;
protected void onCreate(Bundle savedInstanceState) {
RecyclerView listView = (RecyclerView) findViewById(;
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this);
pishguy /
Created September 21, 2017 08:19 — forked from pratamawijaya/
// digunakan untuk Highlight text yang sedang dicari
private void setColor(TextView view, String fulltext, String subtext, int color) {
view.setText(fulltext, TextView.BufferType.SPANNABLE);
Spannable str = (Spannable) view.getText();
int i = fulltext.indexOf(subtext);
str.setSpan(new ForegroundColorSpan(color), i, i + subtext.length(),
pishguy / APP
Last active May 2, 2018 20:33
Implementing JobManager for Dagger2
View APP
public class Alachiq extends MultiDexApplication {
private static Context context;
public static SlidrConfig config;
private GithubService githubService;
private Picasso picasso;
private static GithubApplicationComponent component;
private JobManager jobManager;
private static Alachiq instance;
pishguy / database
Last active December 22, 2019 07:59
View database
import 'package:moor_flutter/moor_flutter.dart';
part 'database.g.dart';
class User extends Table {
IntColumn get id =>integer().autoIncrement()();
IntColumn get active =>integer()();
TextColumn get name =>text()();
TextColumn get email =>text().nullable()();
pishguy /
Created April 16, 2020 18:12 — forked from slightfoot/
Transparent Navigation in #Flutter App. 13th May 2019
import android.os.Build;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import io.flutter.plugins.GeneratedPluginRegistrant;
public class MainActivity extends FlutterActivity
pishguy / slugify.php
Created August 29, 2022 15:18
php sligify function
View slugify.php
public function slugify($string, $separator = '-'): array|string|null
$_transliteration = ["/ö|œ/" => "e",
"/ü/" => "e",
"/Ä/" => "e",
"/Ü/" => "e",
"/Ö/" => "e",
"/À|Á|Â|Ã|Å|Ǻ|Ā|Ă|Ą|Ǎ/" => "",
"/à|á|â|ã|å|ǻ|ā|ă|ą|ǎ|ª/" => "",
"/Ç|Ć|Ĉ|Ċ|Č/" => "",
View wheel.dart
import 'dart:math';
import 'dart:ui';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/physics.dart';
import 'package:flutter/scheduler.dart';
void main() {
// debugDefaultTargetPlatformOverride = TargetPlatform.fuchsia;