Skip to content

Instantly share code, notes, and snippets.

View berkanaslan's full-sized avatar
:shipit:
Focusing

Berkan Aslan berkanaslan

:shipit:
Focusing
View GitHub Profile
@berkanaslan
berkanaslan / kurumlar.json
Last active October 16, 2023 13:04 — forked from aliosmanyuksel/Tükiye Cumhuriyeti Kurumları JSON.json
Türkiye Cumhuriyeti kamu kurumlarının JSON formatında veri listesi. Veriler turkiye.gov.tr adresinden Ocak, 2019 tarihinde alınmıştır.
[
{
"code": "1",
"title": "Adalet Bakanlığı",
"link": "http://www.adalet.gov.tr/",
"tel": "03124177770",
"email": "[email protected]",
"adres": "Vekaletler Cad. Kızılay / ANKARA"
},
{
@berkanaslan
berkanaslan / Tükiye Cumhuriyeti Kurumları JSON.json
Created October 16, 2023 13:03 — forked from aliosmanyuksel/Tükiye Cumhuriyeti Kurumları JSON.json
Türkiye Cumhuriyeti kamu kurumlarının JSON formatında veri listesi. Veriler turkiye.gov.tr adresinden Ocak, 2019 tarihinde alınmıştır.
[
{
"code": "1",
"title": "Adalet Bakanlığı",
"link": "http://www.adalet.gov.tr/",
"tel": "03124177770",
"email": "[email protected]",
"adres": "Vekaletler Cad. Kızılay / ANKARA"
},
{
@berkanaslan
berkanaslan / pt-e550w.dart
Last active December 2, 2022 04:50
pt-e550w print example.
import 'dart:ui' as ui;
import 'package:another_brother/label_info.dart';
import 'package:another_brother/printer_info.dart';
import 'package:flutter/material.dart';
import 'package:permission_handler_platform_interface/permission_handler_platform_interface.dart';
import 'package:qr_flutter/qr_flutter.dart';
void main() {
runApp(MyApp());
@berkanaslan
berkanaslan / RecursivePermutation.java
Created June 4, 2022 11:08
This is a recursive approach for permutation output.
package com.berkanaslan;
import java.util.Scanner;
public class RecursivePermutation {
public static void main(String[] args) {
final String input = getInput();
final String output = "";
permute(input, output);
@berkanaslan
berkanaslan / visibility_controller.dart
Created November 29, 2021 15:06
You can control the visibility depends on scroll position.
class VisibilityController extends StatefulWidget {
final Widget child;
const VisibilityController({Key? key, required this.child}) : super(key: key);
@override
_VisibilityControllerState createState() {
return _VisibilityControllerState();
}
}
@berkanaslan
berkanaslan / chmod-400.cmd
Created June 18, 2021 06:51 — forked from jaskiratr/chmod-400.cmd
Set permission of file equivalent to chmod 400 on Windows.
# Source: https://stackoverflow.com/a/43317244
$path = ".\aws-ec2-key.pem"
# Reset to remove explict permissions
icacls.exe $path /reset
# Give current user explicit read-permission
icacls.exe $path /GRANT:R "$($env:USERNAME):(R)"
# Disable inheritance and remove inherited permissions
icacls.exe $path /inheritance:r
MultiProvider setupProviders() {
return MultiProvider(
providers: [
...
ChangeNotifierProvider<ConnectivityViewModel>(
create: (context) => ConnectivityViewModel(),
lazy: false,
),
...
],
class ConnectivityViewModel with ChangeNotifier {
// -------------------------------------
// Variables
// -------------------------------------
ConnectivityResult _status;
ConnectivityResult get status => _status;
set status(ConnectivityResult status) {
_status = status;
Future<bool> onWillPop(BuildContext context) async {
final currentNavigatorState = currentScreen.navigatorState.currentState;
if (currentNavigatorState.canPop()) {
currentNavigatorState.pop();
return false;
} else {
if (currentTabIndex != FIRST_SCREEN) {
setTab(FIRST_SCREEN);
notifyListeners();
class ExitAlertDialog extends StatelessWidget {
@override
Widget build(BuildContext context) {
return AlertDialog(
title: Text('Çkış'),
content: Text("Çıkış yapmak istediğinizden emin misiniz?"),
actions: <Widget>[
FlatButton(
onPressed: () {
Navigator.of(context).pop(false);