Skip to content

Instantly share code, notes, and snippets.

View alfonsodev's full-sized avatar
🏠

Alfonso alfonsodev

🏠
View GitHub Profile
@alfonsodev
alfonsodev / blurOver.js
Last active April 7, 2016 11:42
blurOver.js
/**
* Sample React Native App
* https://github.com/facebook/react-native
*/
import React, {
AppRegistry,
Component,
StyleSheet,
Text,
@alfonsodev
alfonsodev / google-img-resize.mdown
Created February 25, 2016 11:42
Google’s authentication-less on-the-fly image resizing service

Google's authentication-less on-the-fly image resizing service

I found it while poking around the Google+ HTML. Jotting down some notes felt like a good idea, so here goes. If you know more about this API, let me know, please!

(Word of warning: I spent ~30 minutes on both my experimentation and this here write-up, so it might not be the most thought-provoking, brilliant thing you read today.)

@alfonsodev
alfonsodev / gist:24fd06c598f97cd2bbde
Created February 18, 2016 14:53 — forked from billhathaway/gist:e32060b96802d74ca586
Getting IronMQ on-premise running in Vagrant
# more detailed instructions are at http://dev.iron.io/mq-onpremise/getting_started
# Get a coreos VM up
git clone https://github.com/coreos/coreos-vagrant.git
cd coreos-vagrant/
vagrant up
# get into the coreos box
vagrant ssh
@alfonsodev
alfonsodev / react-native-RNFS.js
Created February 3, 2016 18:08
React-native read bundle dir
var RNFS = require('react-native-fs');
// Read theRNFS.MainBundlePath song and playit
RNFS
.readDir(RNFS.MainBundlePath)
.then((result) => {
AudioPlayer.playWithUrl(result[0].path)
console.log('Audio should play');
});
@alfonsodev
alfonsodev / delegate.md
Last active January 27, 2016 18:38
objectivec delegates

notes taken from : https://www.youtube.com/watch?v=YVikeoR3gYg Communicating between two viewControllers

in the SecondViewController.m

  - (void)saveText {
    [self.delegate sendTextToViewController:@"name here"];
  }

in the SecondViewController.h

@alfonsodev
alfonsodev / playSound.m
Created January 15, 2016 12:36
Play a sound file in ObjC
// from http://codewithchris.com/avaudioplayer-tutorial/
@interface ViewController ()
{
AVAudioPlayer *_audioPlayer;
}
@end
// Construct URL to sound file

This is my response to an email asking about Domain-Driven Design in golang project.

Thank you for getting in touch. Below you will find my thoughts on how golang works with DDD, changing it. This is merely a perception of how things worked out for us in a single project.

That project has a relatively well-known domain. My colleagues on this project are very knowledgeable, thoughtful and invested in quality design. The story spelled out below is a result of countless hours spent discussing and refining the approach.

Conclusions could be very different, if there was a different project, team or a story-teller.

Short story

@alfonsodev
alfonsodev / main.go
Created September 22, 2015 14:14 — forked from shirou/main.go
ansible module written in go-lang. This is almost same as http://ansible.cc/docs/moduledev.html#reading-input
package main
import (
"fmt"
"os"
"io/ioutil"
"strings"
"time"
"encoding/json"
)
@alfonsodev
alfonsodev / install-comodo-ssl-cert-for-nginx.rst
Last active September 17, 2015 09:00 — forked from bradmontgomery/install-comodo-ssl-cert-for-nginx.rst
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

@alfonsodev
alfonsodev / xdebug.md
Last active March 7, 2017 03:44
Setting up xdebug in ubuntu phpstorm

Setting up xdebug (ubuntu) and Phpstorm

sudo pecl install xdebug
sudo touch /etc/php5/mods-available/xdebug.ini
edit /etc/php5/mods-available/xdebug.ini and paste this content in to the file:

zend_extension=/usr/lib/php5/20100525/xdebug.so
xdebug.remote_enable=1
xdebug.remote_connect_back=1
xdebug.remote_port=9000
xdebug.show_local_vars=0