Skip to content

Instantly share code, notes, and snippets.

View kosenshou's full-sized avatar
🎯
Focusing

Louie Aroy kosenshou

🎯
Focusing
  • Hero Innovations
View GitHub Profile
@kosenshou
kosenshou / pokemon-lumen.php
Last active October 31, 2019 11:18
Lumen mini cheat sheet
<?php
/// ROUTES
// GET /pokemon - display a list of pokemon
$router->get('/pokemon', 'PokemonController@index');
$router->group(['middleware' => 'jwt.auth'], function () use ($router) {
// GET /pokemon/id - display specific pokemon
$router->get('/pokemon/{id:[\d]+}', [
@kosenshou
kosenshou / login.php
Created July 25, 2019 04:07
Comment per Algorithm Structure
public function email_login($email, $password) {
// check if email is existing
$this->db->where('email', $email);
$query = $this->db->get('users');
$user = $query->row_array();
// if existing verify password
if ($user != null) {
// if correct password return user information
if ($user["password"] == $password) {
@kosenshou
kosenshou / mac.terminal
Created September 27, 2018 12:31
VSCode terminal
// Terminal connection with RMATE
ssh -R 52698:localhost:52698 HOST_NAME@IP_ADDRESS
//VSCODE
>Remote: Start Server
@kosenshou
kosenshou / FirestoreSamples.kt
Last active March 16, 2020 14:25
Firestore + Kotlin CRUD operations
package com.eleartech.centtochange2
import android.support.v7.app.AppCompatActivity
import android.os.Bundle
import com.google.android.gms.tasks.Task
import com.google.firebase.FirebaseApp
import android.support.annotation.NonNull
import android.support.v4.app.FragmentActivity
import android.util.Log
import com.eleartech.centtochange2.models.Name
@kosenshou
kosenshou / Essentials.java
Created January 25, 2018 14:22
Useful codes for Android Programming
// Hide keyboard when touched outside EditText
@Override
public boolean dispatchTouchEvent(MotionEvent event) {
if (event.getAction() == MotionEvent.ACTION_DOWN) {
View v = getCurrentFocus();
if ( v instanceof EditText) {
Rect outRect = new Rect();
v.getGlobalVisibleRect(outRect);
if (!outRect.contains((int)event.getRawX(), (int)event.getRawY())) {
v.clearFocus();
@kosenshou
kosenshou / TransactionPage.java
Last active February 6, 2018 13:01
Framework for creating and managing multiple inputs (Texts, calendar, radio buttons, etc..)
package com.eleartech.pabor.transaction;
import android.app.Dialog;
import android.content.DialogInterface;
import android.graphics.drawable.ColorDrawable;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@kosenshou
kosenshou / learnphp.php
Last active May 16, 2018 04:52
PHP Cheat sheet
<?php
# DATE
echo "Data processed";
date_default_timezone_set('UTC');
echo date('h:i:s:u a, l F jS Y e');
# FORM POST (variables)
// Place your settings in this file to overwrite the default settings
{
"files.exclude":
{
"**/.DS_Store":true,
"**/.git":true,
"**/.gitignore":true,
"**/.gitmodules":true,
"**/*.booproj":true,
"**/*.pidb":true,
@kosenshou
kosenshou / FixPlist.cs
Created March 10, 2017 07:34
Plist.info fix for ios using fgl enhance
using UnityEngine;
using UnityEditor;
using UnityEditor.Callbacks;
using System.Collections;
using System.IO;
#if UNITY_IOS
using UnityEditor.iOS.Xcode;
#endif
using UnityEditor;
public class BackgroundBlurEditor : MaterialEditor
{
public override void OnInspectorGUI()
{
serializedObject.Update();
if( isVisible )
{