Skip to content

Instantly share code, notes, and snippets.

View manuelgeek's full-sized avatar
😎
#mANuEl💯

Magak Emmanuel manuelgeek

😎
#mANuEl💯
View GitHub Profile
@ck3g
ck3g / example.ex
Created February 14, 2019 16:14
How to read from STDIN in Elixir (for HackerRank)
defmodule Solution do
#Enter your code here. Read input from STDIN. Print output to STDOUT
end
array_length = IO.read(:stdio, :line)
array = IO.read(:stdio, :line)
array_length
|> String.trim
|> String.to_integer
sudo chmod -R a+w storage/app
sudo chmod -R a+w storage/framework
sudo chmod -R a+w storage/logs
sudo chmod -R a+w storage/cache
sudo chmod -R a+w bootstrap/cache
sudo chmod -R a+w .env
sudo chown -R www-data storage/app
sudo chown -R www-data storage/framework
@iberniex
iberniex / Deployment_to_heroku_laravel.md
Last active September 30, 2023 01:57
DEPLOYMENT TO HEROKU LARAVEL

How to Deploy laravel Applications on Heroku.

Heroku-Laravel

Introduction

Welcome to a series of Deploying a Laravel Application.

Laravel applications are deployed on many sites.

I will be taking you through on how to deploy a laravel application which has a database and to be specific, Postgresql Database.

@manuelgeek
manuelgeek / instructions.php
Last active August 16, 2018 21:18
Serverside datatables with Yajra in laravel yajra/laravel-datatables
Listing items in tables is one of the ,ost essential while building dashboards. Datatables https://datatables.net/ Add advanced interaction controls
to your HTML tables which we mostly do on the client side. Using the same approach to load large rows of data from the database
always becomes slow as the data grows bigger and bigger untl at some point the datatable break. This is a major reason to
consider using datatables from the start of your development to avoid such. Thats what we are goint to do.
Create a new laravel project composer create-project --prefer-dist laravel/laravel datatable-test
change the .env for database connections
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=datatables-test
import java.util.Random;
import java.util.Arrays;
public class LinearArray
{
private int[] data; // array of values
private static final Random generator = new Random();
public LinearArray( int size )
{
data = new int[ size ];
for ( int i = 0; i < size; i++ )
@manuelgeek
manuelgeek / \Illuminate\Session\TokenMismatchException
Created July 14, 2018 20:02
Token Mismach Exception Handling in Laravel
Replace your app\Exceptions\Handler.php render() function with this
/**
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
* @param \Exception $exception
* @return \Illuminate\Http\Response
*/
public function render($request, Exception $exception)
{
@manuelgeek
manuelgeek / MailChimpController.php
Last active February 13, 2019 23:32
a simple subscription code with Laravel 5.6 and MailChimp
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Auth;
use Config;
public class TestController : ApiController
{
[HttpGet]
public IEnumerable<Student> Students()
{
return StudentCrud.GetStudents();
}
}
public class Student
{
public Guid Id { get; set; }
public string Name { get; set; }
public int Marks { get; set; }
}
///////
public class StudentCrud
@abel-masila
abel-masila / AppServiceProvider.php
Created February 7, 2018 15:57
yntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes (SQL: alter table users add unique users_email_unique(email))
use Illuminate\Support\Facades\Schema;
public function boot()
{
Schema::defaultStringLength(191);
}