Skip to content

Instantly share code, notes, and snippets.

View joaonzangoII's full-sized avatar

Joao Nzango II joaonzangoII

View GitHub Profile
@trejo08
trejo08 / morse.rb
Last active December 30, 2022 05:26
Morse Code translator written in Ruby as solution of CodementorX Assessment.
class Morse
def posibilities(signals)
signals.include?('?') ? check_wildcard(signals) : morses["#{signals}"]
end
def check_wildcard(signals)
length = signals.split('').length
values = []
if length.eql?(1)
values = ["E", "T"]
@AlexJuca
AlexJuca / observer.kt
Created August 20, 2018 11:51
Kotlin Observer Pattern
import kotlin.properties.Delegates
fun main(args: Array<String>) {
val kumbu = Wallet(0)
kumbu.listener = AccountChangedListener()
println("Saldo geral: ${kumbu.balance}")
kumbu.premiumAccount = true
println(kumbu.premiumAccount)
kumbu.premiumAccount = false
<div id="actions" class="row my-4">
<div class="col-lg-7">
<!-- The fileinput-button span is used to style the file input field as button -->
<span class="btn btn-success fileinput-button dz-clickable">
<i class="icon-plus small-text"></i>
<span>Add files...</span>
</span>
<button type="submit" class="btn btn-primary start">
<i class="icon-arrow-circle-o-up icon-offset"></i>
@xxRockOnxx
xxRockOnxx / Handler.php
Last active January 20, 2021 21:35
[Laravel] Convert dot array validation error to nested array
<?php
namespace App\Exceptions;
class Handler
{
/**
* Convert a validation exception into a JSON response.
*
* @param \Illuminate\Http\Request $request
@bateller
bateller / FizzBuzz.php
Last active May 29, 2024 14:57
FizzBuzz solution in PHP
<?php
if (php_sapi_name() === 'cli') $lb = "\n";
else $lb = "<br />";
for ($i = 1; $i <= 100; $i++)
{
if ($i % 15 === 0) {
echo "FizzBuzz $lb";
}
@srmds
srmds / Installing wkhtmltopdf 0.12.6, 0.12.5, 0.12.4 - Ubuntu 22.06 , 18.04, 16.04 x64, 0.12.6 - MacOS Ventura 13.6.md
Last active June 14, 2024 13:47
Installing wkhtmltopdf 0.12.4, 0.12.5 0.12.6 - Ubuntu 22.04 - 0.12.6, 16.04 x64, 0.12.5 - Ubuntu 18.04 x64 - 0.12.5 - macOS Ventura -13.6
@hoandang
hoandang / php-docker-ext
Created May 20, 2017 01:12
Complete list of php docker ext
RUN apt update
RUN apt upgrade -y
RUN apt install -y apt-utils
RUN a2enmod rewrite
RUN apt install -y libmcrypt-dev
RUN docker-php-ext-install mcrypt
RUN apt install -y libicu-dev
RUN docker-php-ext-install -j$(nproc) intl
RUN apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng12-dev
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/
@nrollr
nrollr / MySQL_macOS_Sierra.md
Last active June 7, 2024 20:53
Install MySQL on Sierra using Homebrew

Install MySQL on macOS Sierra

This procedure explains how to install MySQL using Homebrew on macOS Sierra 10.12

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.

Install MySQL

At this time of writing, Homebrew has MySQL version 5.7.15 as default formulae in its main repository :

@dungmanh88
dungmanh88 / backup_collection_mongo.sh
Last active January 22, 2024 07:42
Dump multiple collections of a db in mongodb
#!/bin/bash
db=<db>
collection_list="<collection1> <collection2> <collection3>"
host=127.0.0.1
port=<port>
out_prefix=/Temp
for collection in $collection_list; do
echo $collection
out_dir="${out_prefix}/${db}_${collection}/"
@JacobBennett
JacobBennett / ReadMe.MD
Last active September 30, 2023 09:14
Loading Laravel Sentry only for production

Loading Laravel Sentry package only for production

In the case that you don't want development errors making their way to Sentry for error tracking, you can use the code below to ensure that Sentry will only record exceptions when in production.

First, instead of loading the SentryLaravelServiceProvider in the config/app.php providers array, we will load it in our App/Providers/AppServiceProvider.php. This allows us to check the environment before loading the appropriate service providers.

Seconly, in our App/Exceptions/Handler.php we again check for the production environment before trying to capture the exception using Sentry. This second step prevents Sentry from trying to catch an exception when it isn't bound in the container.