Skip to content

Instantly share code, notes, and snippets.

View aindong's full-sized avatar
🎯
Focusing

Alleo Indong aindong

🎯
Focusing
View GitHub Profile
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 / .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]
@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
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`,
// 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;
@aindong
aindong / smoothScroll.js
Created February 10, 2017 17:50
Smooth Scroll Utility Helper for ReactJs or JS applications
export const smoothScroll = {
timer: null,
stop: function () {
clearTimeout(this.timer);
},
scrollTo: function (id, callback) {
let settings = {
duration: 1000,
@aindong
aindong / actionTypes.js
Created February 10, 2017 17:52
action type factory for react redux
export default function createActionTypes(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 / helper.php
Created February 25, 2017 00:06
make current nagivation link active
//throw this in your helper.php
function set_active($path, $active = 'active') {
return call_user_func_array('Request::is', (array)$path) ? $active : '';
}
// use it like so
<a class="{{ set_active(['admin/institutes*','admin/courses*']) }}">Learning</a>
@aindong
aindong / export.swift
Last active January 8, 2023 20:23
Export Core Data into CSV in Swift 3
func createExportString() -> String {
var name : String?
var age : String?
var mobile : String?
var email : String?
var promo_crayola_bunding : Int16?
var promo_zip_it : Int16?
var promo_none : Int16?
var created : NSDate? = NSDate()
@aindong
aindong / API.md
Created April 18, 2017 10:05 — forked from iros/API.md
Documenting your REST API

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method: