Skip to content

Instantly share code, notes, and snippets.

View arielmagbanuazeald's full-sized avatar
🎯
Focusing

Ariel Magbanua arielmagbanuazeald

🎯
Focusing
View GitHub Profile
@arielmagbanuazeald
arielmagbanuazeald / EvenOddPositiveNegative.md
Last active September 16, 2021 07:07
EvenOddPositiveNegative

Even / Odd / Positive / Negative

Create a program that can identify of a integer is even or odd and if it is positive or negative.

Starter Code

public class App {
    public static void main(String[] args) throws Exception {
        // scanner
 Scanner scanner = new Scanner(System.in);
@arielmagbanuazeald
arielmagbanuazeald / git_submodules.md
Created April 4, 2020 05:43 — forked from gitaarik/git_submodules.md
Git Submodules basic explanation

Git Submodules basic explanation

Why submodules?

In Git you can add a submodule to a repository. This is basically a repository embedded in your main repository. This can be very useful. A couple of advantages of using submodules:

  • You can separate the code into different repositories.
@arielmagbanuazeald
arielmagbanuazeald / TestIbsQueryBuilder.cs
Created February 21, 2020 00:55 — forked from arielmagbanua/TestIbsQueryBuilder.cs
Test Class for IbsQueryBuilder.cs
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace ConsoleNancySelfHostedNetTest
{
[TestClass]
public class TestIbsQueryBuilder
{
public class MyModel : IbsQueryBuilder
{
@arielmagbanuazeald
arielmagbanuazeald / IbsQueryBuilder.cs
Created February 21, 2020 00:55 — forked from arielmagbanua/IbsQueryBuilder.cs
IbsQueryBuilder Abstract Class that Mimics Laravel ORM for IBS Gateway Builder
using System;
using System.Text.RegularExpressions;
namespace ConsoleNancySelfHostedNetTest
{
public abstract class IbsQueryBuilder
{
private string _queryCriteria = "";
public virtual IbsQueryBuilder Where(string col, string arg1, string arg2 = null)
@arielmagbanuazeald
arielmagbanuazeald / gist:b091162e1702e671b999a9b4606d0ece
Created February 13, 2020 01:26 — forked from thecodejunkie/gist:2031677
Dynamic model to json using Nancy
Get["/"] = _ => {
dynamic model = new ExpandoObject();
model.Name = "Nancy";
return Response.AsJson((object)model);
};
@arielmagbanuazeald
arielmagbanuazeald / macro.md
Created July 17, 2019 07:04 — forked from brunogaspar/macro.md
Recursive Laravel Collection Macros

What?

If a nested array is passed into a Laravel Collection, by default these will be threaded as normal arrays.

However, that's not always the ideal case and it would be nice if we could have nested collections in a cleaner way.

This is where this macro comes in handy.

Setup

@arielmagbanuazeald
arielmagbanuazeald / transformKeys.php
Created July 9, 2019 06:35 — forked from goldsky/transformKeys.php
Convert under_score type array's keys to camelCase type array's keys and likewise
<?php
/**
* Convert under_score type array's keys to camelCase type array's keys
* @param array $array array to convert
* @param array $arrayHolder parent array holder for recursive array
* @return array camelCase array
*/
public function camelCaseKeys($array, $arrayHolder = array()) {
$camelCaseArray = !empty($arrayHolder) ? $arrayHolder : array();
@arielmagbanuazeald
arielmagbanuazeald / stylesheet
Created May 24, 2019 04:43
ProductDisplay/Product Stylesheet
div .component_ProductDisplay_Product {
padding: 0;
margin: 0;
}
div.component_ProductDisplay_CrossSellHorizontal {
padding: 0;
}
div .product {
margin: 0 20px;
}
@arielmagbanuazeald
arielmagbanuazeald / template.html
Created May 24, 2019 04:39
ProductDisplay/Product Component new template.
[template version=2]
[comment]
# If the product is inactive, this component will respond in 2 ways
# 1. if the user is a customer, it will display the 'Product is disabled message' only.
# 2. if the user is an admin, it will display a notification saying the product is inactive
# but will still render the rest of the component
[/comment]
<article class="product">
[if v inactive]
[if session admin]
@arielmagbanuazeald
arielmagbanuazeald / laravel-worker.conf
Created January 16, 2019 01:41 — forked from arielmagbanua/laravel-worker.conf
laravel worker sample config file
[program:laravel-worker]
process_name=%(program_name)s_%(process_num)02d
command=php home/vagrant/Code/lead_reactor/artisan queue:work database --sleep=3 --tries=3 --daemon
autostart=true
autorestart=true
user=vagrant
numprocs=8
redirect_stderr=true
stdout_logfile=home/vagrant/Code/lead_reactor/storage/logs/laravel-worker.log