Skip to content

Instantly share code, notes, and snippets.

View p4yam's full-sized avatar
🏠
Working from home

Payam Asefi p4yam

🏠
Working from home
View GitHub Profile
class _MainPagerState extends State<MainPager>
with AutomaticKeepAliveClientMixin {
int _selectedIndex = 0;
Icon _foods = Icon(MdiIcons.foodApple);
Icon _favorite = Icon(Icons.favorite_border);
Icon _shoppingList = Icon(Icons.playlist_add);
bool _darkMode = true;
PageController _pagerController =
PageController(initialPage: 0, keepPage: false);
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:layout_width="match_parent"
android:id="@+id/mSwipeLayout"
package ir.kivee.testmap.view;
import android.Manifest;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.location.Location;
import android.location.LocationManager;
@p4yam
p4yam / raspberry-pi-vpn-router.md
Created October 23, 2017 10:20 — forked from superjamie/raspberry-pi-vpn-router.md
Raspberry Pi VPN Router

Raspberry Pi VPN Router

This is a quick-and-dirty guide to setting up a Raspberry Pi as a "router on a stick" to PrivateInternetAccess VPN.

Requirements

Install Raspbian Jessie (2016-05-27-raspbian-jessie.img) to your Pi's sdcard.

Use the Raspberry Pi Configuration tool or sudo raspi-config to:

@p4yam
p4yam / MainActivity.java
Last active February 12, 2017 16:48
get android hardware info
package ir.kivee.androidsysteminfo;
import android.os.Build;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
public class MainActivity extends AppCompatActivity {
@p4yam
p4yam / activity_main.xml
Last active February 12, 2017 16:55
get android hardware info
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"