This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class QrActivity extends AppCompatActivity implements QRCodeReaderView.OnQRCodeReadListener { | |
private QRCodeReaderView qrCodeReaderView; | |
private static final int MY_CAMERA_REQUEST_CODE = 100; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_qr); | |
if (checkSelfPermission(Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Update and Upgrade System | |
sudo apt update | |
sudo apt upgrade | |
sudo apt dist-upgrade | |
# Install Tweaks (To enable dark mode and more) | |
sudo apt install software-properties-common | |
sudo add-apt-repository ppa:philip.scott/elementary-tweaks | |
sudo apt install elementary-tweaks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo apt update | |
$ sudo apt install postgresql postgresql-contrib libpq-dev | |
$ sudo -u postgres createuser --interactive | |
> Enter name of role to add: yunus # Current OS Username | |
> Shall the new role be a superuser? (y/n) y | |
## This should work :) | |
## If any error comes up, the link at the bottom might help |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" > | |
<item> | |
<shape> | |
<corners android:radius="10dp" /> | |
<solid android:color="#ffffff" /> | |
<stroke | |
android:dashGap="5dp" | |
android:dashWidth="5dp" | |
android:width="3dp" | |
android:color="#0000FF" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.os.Bundle; | |
import android.view.LayoutInflater; | |
import android.view.View; | |
import android.view.ViewGroup; | |
import com.google.android.material.bottomsheet.BottomSheetDialogFragment; | |
public class LocationPermissionBottomSheet extends BottomSheetDialogFragment { | |
@Override | |
public View onCreateView (LayoutInflater inflater, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MapActivity extends AppCompatActivity { | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
// Download and set image of profile button. (async) | |
new DownloadButtonImageTask().execute( | |
new DownloadButtonImageTaskParams("https://images.unsplash.com/photo-1555436169-f998ad1259fd?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=634&q=80", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SomeActivity { | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.webview_in_drawer_layout); | |
// ... | |
DrawerLayout drawerLayout = findViewById(R.id.drawer_layout); | |
ActionBarDrawerToggle toggle = new ActionBarDrawerToggle( | |
this, drawerLayout, null, R.string.app_name, R.string.app_name); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:id="@+id/main_view"> | |
<com.google.android.material.floatingactionbutton.FloatingActionButton | |
android:id="@+id/notifications_button" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MainActivity extends AppCompatActivity implements TurbolinksAdapter { | |
// Change the BASE_URL to an address that your VM or device can hit. | |
private static final String BASE_URL = "http://10.0.1.100:9292"; | |
private static final String INTENT_URL = "intentUrl"; | |
String tab1_path = "/tab1"; | |
String tab2_path = "/tab2"; | |
boolean tab1_is_visited = false; | |
boolean tab2_is_visited = false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="row"> | |
<% photos.each_with_index do |photo, i| %> | |
<% if i == 0 %> | |
<%= render partial: 'image', locals: { image: image, col_length: 12, square: false }, cached: true %> | |
<% else %> | |
<%= render partial: 'image', locals: { image: image, col_length: 4, square: true }, cached: true %> | |
<% end %> | |
<% end %> | |
</div> |