Skip to content

Instantly share code, notes, and snippets.

View pedrofurtado's full-sized avatar
🤓
👍

Pedro Furtado pedrofurtado

🤓
👍
View GitHub Profile
@sanketsudake
sanketsudake / kind-kubernetes-metrics-server.md
Last active April 5, 2024 07:06
Running metric-server on Kind Kubernetes

I have created a local Kubernetes cluster with kind. Following are changes you need to get metric-server running on Kind.

Deploy latest metric-server release.

kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/download/v0.5.0/components.yaml

Within existing arguments to metric-server container, you need to add argument --kubelet-insecure-tls.

@RuChuanLin
RuChuanLin / HashTableOpenAddressing.java
Last active January 7, 2021 17:08 — forked from pedrofurtado/HashTableOpenAddressing.java
Implementation of Hash Table (with Open Addressing) in Java.
/**
* Hash table with open addressing.
*
* <p>This contains some common methods of Map interface, including size, isEmpty, put, get, remove,
* containsKey
*
* <p>For open addressing hash table, we use 100% of the inner array space, and it is a close
* hashing. When collision occurs, it has to find an empty position to store the element. Pedro
* provided few methods to probe a new index. I am not quite familiar with quadratic probing, so the
* default probing method is linear probing, which means if the index is occupied, it automatically
@austoonz
austoonz / SQS-SNS-Subscription
Last active January 23, 2024 22:35
A CloudFormation template sample to subscribe an SQS Queue to an SNS Topic.
---
AWSTemplateFormatVersion: '2010-09-09'
Description: SQS Queue subscribed to an SNS Topic
Parameters:
SourceSNSTopicArn:
Type: String
Description: SNS Topic Arn to subscribe the SQS Queue to
@Nks
Nks / MediaVideoConverterListener.php
Last active February 15, 2024 02:18
Laravel Media Library converting video to .mp4 after saving
<?php
namespace App\Listeners;
use App\Media;
use FFMpeg\FFMpeg;
use FFMpeg\Format\Video\X264;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\SerializesModels;
@cviebrock
cviebrock / ElasticLoggingProvider.php
Created September 29, 2016 14:57
Log Laravel to Elastic/Logstash
<?php namespace App\Providers;
use Elastica\Client;
use Illuminate\Support\ServiceProvider;
use Monolog\Formatter\LogstashFormatter;
use Monolog\Handler\ElasticSearchHandler;
class ElasticLoggingProvider extends ServiceProvider
{
@Nks
Nks / Model.php
Created August 18, 2016 15:30
Laravel 5.2 user spy-fields (created_by, updated_by, deleted_by) support
<?php
namespace App\Models;
use Auth;
use Illuminate\Database\Eloquent\Model as BaseModel;
class Model extends BaseModel
{
protected $userAttributes = [];
@btroncone
btroncone / ngrxintro.md
Last active February 9, 2024 15:37
A Comprehensive Introduction to @ngrx/store - Companion to Egghead.io Series

Comprehensive Introduction to @ngrx/store

By: @BTroncone

Also check out my lesson @ngrx/store in 10 minutes on egghead.io!

Update: Non-middleware examples have been updated to ngrx/store v2. More coming soon!

Table of Contents

@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@filewalkwithme
filewalkwithme / main.go
Created February 7, 2015 21:50
Listening multiple ports on golang http servers
package main
import (
"net/http"
)
func main() {
finish := make(chan bool)
server8001 := http.NewServeMux()