Skip to content

Instantly share code, notes, and snippets.

View alfonsodev's full-sized avatar
🏠
Working from home

Alfonso alfonsodev

🏠
Working from home
View GitHub Profile
@alfonsodev
alfonsodev / WaitForCommand.php
Created January 14, 2019 11:24
Wait for is useful for docker images
<?php
namespace App\Command;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Output\OutputInterface;
use App\Service\CacheService;
class WaitForCommand extends ContainerAwareCommand
@alfonsodev
alfonsodev / tutorial.md
Created November 10, 2018 14:58
symfony 4 tutorial

Symfony 4 tutorial

Creating the project

Project has been created with symfony new project template

composer create-project symfony/website-skeleton demo

init repo and commit

cd demo
@alfonsodev
alfonsodev / kafka.rb
Last active August 8, 2018 14:50
Kafka 0.9
class Kafka < Formula
desc "Publish-subscribe messaging rethought as a distributed commit log"
homepage "https://kafka.apache.org/"
url "https://archive.apache.org/dist/kafka/0.9.0.0/kafka_2.11-0.9.0.0.tgz"
sha256 "6e20a86cb1c073b83cede04ddb2e92550c77ae8139c4affb5d6b2a44447a4028"
bottle do
cellar :any_skip_relocation
sha256 "67105a99b29380f4af1e124de0ce92cda4d90eeb1cac0ee4bfc7771a9b408213" => :high_sierra
sha256 "67105a99b29380f4af1e124de0ce92cda4d90eeb1cac0ee4bfc7771a9b408213" => :sierra
@alfonsodev
alfonsodev / multiple_ssh_setting.md
Created February 6, 2018 21:26 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
// Retry 5 times with waiting for 2 seconds
function* updateApi(data) {
for(let i = 0; i < 5; i++) {
try {
const apiResponse = yield call(apiRequest, { data });
return apiResponse;
} catch(err) {
if(i < 4) {
yield call(delay, 2000);
}
@alfonsodev
alfonsodev / install-ffmpeg-amazon-linux.sh
Last active November 14, 2017 08:00 — forked from gboudreau/install-ffmpeg-amazon-linux.sh
How to compile ffmpeg on Amazon Linux (EC2)
#!/bin/sh
# Based on gist.github.com/gboudreau/install-ffmpeg-amazon-linux.sh
# and https://trac.ffmpeg.org/wiki/CompilationGuide/Centos
if [ "`/usr/bin/whoami`" != "root" ]; then
echo "You need to execute this script as root."
exit 1
fi
cat > /etc/yum.repos.d/centos.repo<<EOF
@alfonsodev
alfonsodev / AndroidManifest.xml
Created October 24, 2017 09:47
for react-native-firebase issue #498
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.myApp"
android:versionCode="4"
android:versionName="1.0">
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
@alfonsodev
alfonsodev / action-creator-vs-reducer.md
Created October 22, 2017 11:13 — forked from kof/action-creator-vs-reducer.md
Action creator vs. reducer

When should you use action creator and when reducer?

Action creator

  • you need to have side effects
  • you need to read from store to decide what to do
  • you need to dispatch more than one action
  • action produced by action creator needs to contain all the data reducer can need to shape the components state

Reducer

  • should not have any side effects
@alfonsodev
alfonsodev / Podfile
Created October 16, 2017 12:22
Podfile for reac-native-firebase issue report
source 'https://github.com/CocoaPods/Specs.git'
project 'MyApp.xcodeproj'
platform :ios, '9.0'
plugin 'cocoapods-keys', {
:project => 'MyApp',
:keys => [
"MixPanelToken",
]
}
@alfonsodev
alfonsodev / build.gradle
Created October 12, 2017 14:31
react-native-firebase issue with react-native-navigation
apply plugin: "com.android.application"
import com.android.build.OutputFile
apply from: "../../node_modules/react-native/react.gradle"
def enableSeparateBuildPerCPUArchitecture = false
/**