Skip to content

Instantly share code, notes, and snippets.

View amadiyawa's full-sized avatar

Amadou Iyawa amadiyawa

  • Cameroon
  • 19:56 (UTC -12:00)
View GitHub Profile
@amadiyawa
amadiyawa / create-hotspot.md
Created November 14, 2021 15:13 — forked from narate/create-hotspot.md
Create Wi-Fi Hotspot on Linux using nmcli

Create a Wi-Fi hotspot on Linux using nmcli

Original post : https://unix.stackexchange.com/a/310699

nmcli con add type wifi ifname wlan0 con-name Hostspot autoconnect yes ssid Hostspot
nmcli con modify Hostspot 802-11-wireless.mode ap 802-11-wireless.band bg ipv4.method shared
nmcli con modify Hostspot wifi-sec.key-mgmt wpa-psk
nmcli con modify Hostspot wifi-sec.psk "veryveryhardpassword1234"
@amadiyawa
amadiyawa / JsonHelper.java
Created May 16, 2020 12:38 — forked from codebutler/JsonHelper.java
Convert Android JSONObject/JSONArray to a standard Map/List.
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.*;
public class JsonHelper {
public static Object toJSON(Object object) throws JSONException {
if (object instanceof Map) {
JSONObject json = new JSONObject();

Installing and Basic Programs on MPI C

Installing MPI on Ubuntu

Run the following command on terminal

$ sudo apt-get install libcr-dev mpich2 mpich2-doc

Compiling MPI Programs

@amadiyawa
amadiyawa / Install_gcc7_ubuntu_16.04.md
Created April 16, 2019 06:23 — forked from jlblancoc/Install_gcc7_ubuntu_16.04.md
Installing gcc-7 & g++-7 in Ubuntu 16.04LTS Xenial

Run the following in the terminal:

Install the gcc-7 packages:

sudo apt-get install -y software-properties-common
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt update
sudo apt install g++-7 -y

Set it up so the symbolic links gcc, g++ point to the newer version:

@amadiyawa
amadiyawa / gist:2b65a57554b21b24feb638dee5eb6573
Created January 23, 2019 19:14 — forked from mikehaertl/gist:3258427
Learn you a Haskell - In a nutshell

Learn you a Haskell - In a nutshell

This is a summary of the "Learn You A Haskell" online book under http://learnyouahaskell.com/chapters.


1. Introduction

  • Haskell is a functional programming language.
@amadiyawa
amadiyawa / pagination.php
Created September 18, 2018 18:44 — forked from rashedcs/pagination.php
Pagination with PHP & MYSQL
<?php
$num_rec_per_page=10;
mysql_connect('localhost','root','');
mysql_select_db('apex1');
if (isset($_GET["page"])) { $page = $_GET["page"]; } else { $page=1; };
$start_from = ($page-1) * $num_rec_per_page;
$sql = "SELECT * FROM student LIMIT $start_from, $num_rec_per_page";
$rs_result = mysql_query ($sql); //run the query
?>
<table>
<?php namespace PatrickMaciel;
class BaseController extends \Controller {
/**
* Setup the layout used by the controller.
*
* @return void
*/
protected function setupLayout()
@amadiyawa
amadiyawa / php-style-guide.md
Created August 16, 2018 16:56 — forked from ryansechrest/php-style-guide.md
PHP style guide with coding standards and best practices.

PHP Style Guide

All rules and guidelines in this document apply to PHP files unless otherwise noted. References to PHP/HTML files can be interpreted as files that primarily contain HTML, but use PHP for templating purposes.

The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.

Most sections are broken up into two parts:

  1. Overview of all rules with a quick example
  2. Each rule called out with examples of do's and don'ts