Skip to content

Instantly share code, notes, and snippets.

View mohsin's full-sized avatar

Saifur Rahman Mohsin mohsin

View GitHub Profile
@GhazanfarMir
GhazanfarMir / Instructions.sh
Last active May 14, 2024 03:26
Install PHP7.2 NGINX and PHP7.2-FPM on Ubuntu 16.04
########## Install NGINX ##############
# Install software-properties-common package to give us add-apt-repository package
sudo apt-get install -y software-properties-common
# Install latest nginx version from community maintained ppa
sudo add-apt-repository ppa:nginx/stable
# Update packages after adding ppa
@wayanjimmy
wayanjimmy / install_php71.sh
Last active October 2, 2019 14:28
Install php7.1 ubuntu 16.04 EC2
sudo apt-get update -y
sudo apt-get install -y nginx
sudo apt-get install -y python-software-properties
sudo add-apt-repository -y ppa:ondrej/php
sudo apt-get update -y
sudo apt-get install -y php7.1 php7.1-fpm php7.1-cli php7.1-common php7.1-mbstring php7.1-gd php7.1-intl php7.1-xml php7.1-mysql php7.1-mcrypt php7.1-zip
sudo apt-get install php-curl
@yanngx
yanngx / FragmentArgumentDelegate.kt
Last active January 19, 2023 09:26
Fragment arguments without hassle !
package be.brol
import android.os.Binder
import android.os.Bundle
import android.support.v4.app.BundleCompat
import android.support.v4.app.Fragment
/**
* Eases the Fragment.newInstance ceremony by marking the fragment's args with this delegate
* Just write the property in newInstance and read it like any other property after the fragment has been created
@actuino
actuino / bt_speaker-raspberry_pi-zero_w.md
Last active May 7, 2024 18:38
Setting up a Bluetooth Speaker from the command line on a raspberry Pi Zero W

The setup of a bluetooth speaker on a Pi Zero W is pretty touchy.

Please get in touch via Twitter @actuino or http://www.actuino.fr/ if you've got comments or improvements to this quick draft.

First checks

  • Use a solid power source
  • check the speaker works on another hardware (android phone f.i.)
  • make sure you've updated your Raspbian, install and run rpi-update just in case.
@webserveis
webserveis / material text sizes.md
Last active September 20, 2023 10:10 — forked from passsy/material text sizes.md
Material font sizes

Material text sizes XML for Android

Simple helper file for standard text sizes in material design. The sizes are provided by the material design documentation https://www.google.com/design/spec/style/typography.html#typography-roboto

material typography

Standard Styles

Too many type sizes and styles at once can wreck any layout. A typographic scale is a limited set of type sizes that work well together, along with the layout grid. The basic set of styles are based on a typographic scale of 12, 14, 16, 20, and 34.

@lukesims
lukesims / .gitignore
Created October 17, 2016 22:26
OctoberCMS .gitignore
# ------------------------------------------------------------------------------
# .gitignore for OctoberCMS (http://octobercms.com/)
# Based on https://gist.github.com/salcode/b515f520d3f8207ecd04 for WordPress
# ------------------------------------------------------------------------------
# By default all files are ignored.
#
# At the end of the file you will need to whitelist themes and plugins you want
# to include in the repo.
#
# Update the {PLACEHOLDERS} to reflect your setup.
@mauricegavin
mauricegavin / ObservableRxList.java
Created February 29, 2016 18:15
ObservableRxList
import java.util.ArrayList;
import java.util.List;
import java.util.ListIterator;
import rx.Observable;
import rx.subjects.PublishSubject;
/**
* http://stackoverflow.com/questions/28816691/how-can-i-create-an-observer-over-a-dynamic-list-in-rxjava
*/
@eirabben
eirabben / MainFragment.java
Created November 18, 2015 16:43
Android navigation drawer inside fragment.
public class MainFragment extends Fragment {
private DrawerLayout mDrawer;
private Toolbar mToolbar;
private ActionBarDrawerToggle mDrawerToggle;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setHasOptionsMenu(true);
}
@cesarferreira
cesarferreira / RxJava.md
Last active February 2, 2022 07:28
Party tricks with RxJava, RxAndroid & Retrolambda

View Click

Instead of the verbose setOnClickListener:

RxView.clicks(submitButton).subscribe(o -> log("submit button clicked!"));

Filter even numbers

Observable
    .just(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
package org.paulbetts.shroom.core;
import android.os.AsyncTask;
import com.squareup.okhttp.*;
import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.util.Arrays;