Skip to content

Instantly share code, notes, and snippets.

View aindong's full-sized avatar
🎯
Focusing

Alleo Indong aindong

🎯
Focusing
View GitHub Profile
// Create a new interface
public interface UIUpdatable {
public void updateUI(String message);
}
// Implement the new interface on the activity
public class QuestionNew extends AppCompatActivity implements UIUpdatable {
public TextView txtView;
export default function constFactory(entityName) {
const ENTITY = entityName.toUpperCase();
return {
LOAD_START: `LOAD_${ENTITY}S_START`,
LOAD_SUCCESS: `LOAD_${ENTITY}S_SUCCESS`,
LOAD_NO_CONNECTION: `LOAD_${ENTITY}S_NO_CONNECTION`,
LOAD_ERROR: `LOAD_${ENTITY}S_ERROR`,
@aindong
aindong / zip.sh
Last active November 20, 2016 11:18
Zip new files into different archive, LINuX
zip -r Scripts.zip Scripts -DF --out new.zip
@aindong
aindong / .htaccess
Created September 14, 2016 07:37
Redirect http to https using aws load balancer and .htaccess
RewriteEngine on
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
import java.io.*;
import java.util.Scanner;
class GuessMyNumber {
protected int min = 1;
protected int max = 31;
public static void main(String args[])
{
GuessMyNumber instance = new GuessMyNumber();
@aindong
aindong / fetch.js
Created August 19, 2016 13:25
Generic Fetch option
import {
getAuthToken
} from './token.js';
export const fetchOpts = (method, body = null) => {
return Object.assign({}, {
method,
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'Authorization': `Bearer ${getAuthToken()}`
@aindong
aindong / aws-micro-composer-fix
Created August 9, 2016 16:20
Fix Composer Out Of Memory Error by adding swap memory to your aws micro instance
/bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=1024
/sbin/mkswap /var/swap.1
/sbin/swapon /var/swap.1
@aindong
aindong / Fix Git Ignore
Created June 1, 2016 03:49
FIX GIT IGNORE
git rm -r --cached .
git add .
git commit -m "fixed untracked files"
@aindong
aindong / Toolbar Back icon not working fix
Last active February 20, 2016 15:55
Toolbar Back icon not working fix
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onBackPressed();
}
});
@aindong
aindong / nginx.default.conf
Last active November 18, 2015 16:37 — forked from santoshachari/nginx.default.conf
PHP5.6 and NGINX: Install PHP56-FPM, Nginx & MySQL on EC2 with Amazon Linux AMI
# Install linux update, followed by GCC and Make
sudo yum -y update
sudo yum install -y gcc make
# Install Nginx and php56-FPM
sudo yum install -y nginx php56-fpm
# Install php56 extensions
sudo yum install -y php56-devel php56-mysql php56-pdo php56-pear php56-mbstring php56-cli php56-odbc php56-imap php56-gd php56-xml php56-soap