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 / 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 / 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
@arielmagbanuazeald
arielmagbanuazeald / deploy.sh
Created January 9, 2019 06:53 — forked from BenSampo/deploy.sh
Laravel deploy script
# Change to the project directory
cd /home/forge/domain.com
# Turn on maintenance mode
php artisan down
# Pull the latest changes from the git repository
git pull origin master
# Install/update composer dependecies
@arielmagbanuazeald
arielmagbanuazeald / Vagrantfile.diff
Created January 8, 2019 22:20 — forked from dgoguerra/Vagrantfile.diff
Homestead v2.0.0 configuration
diff --git a/Vagrantfile b/Vagrantfile
index 12b8f52..7b77ab2 100644
--- a/Vagrantfile
+++ b/Vagrantfile
@@ -17,6 +17,11 @@ require File.expand_path(File.dirname(__FILE__) + '/scripts/homestead.rb')
Vagrant.require_version '>= 1.9.0'
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
+
+ config.vm.provider 'virtualbox' do |vb|