Skip to content

Instantly share code, notes, and snippets.

View alfonsodev's full-sized avatar
🏠

Alfonso alfonsodev

🏠
View GitHub Profile
@alfonsodev
alfonsodev / keybase.md
Created June 12, 2017 10:59
keybase.md

Keybase proof

I hereby claim:

  • I am alfonsodev on github.
  • I am alfonsodev (https://keybase.io/alfonsodev) on keybase.
  • I have a public key ASC8x5RyAQekfCjTYePcqDGs6TYrFOhZ2eXgTVhBzh9CPwo

To claim this, I am signing this object:

@alfonsodev
alfonsodev / gist:534630b8c3ba3cd267574592654b5d15
Last active April 12, 2017 20:42
configure gitlab deploy vm on vultr
@alfonsodev
alfonsodev / README.md
Last active February 7, 2017 14:30
javascript babel-webpack latest basic boilerplate

Basic manual babel latests + webpack boilerplate.

npm init -y

Install npm modules

npm install --save-dev babel babel-core babel-loader babel-preset-latest-node6 json-loader webpack 

copy the webpack.config.js file to your project.

The webpack.config.js is in this same gist.

body {
padding-top: 120px;
padding-bottom: 40px;
background-color: #eee;
}
.container {
width: 50%;
}
.btn
{
@alfonsodev
alfonsodev / refactoring-react-views.md
Last active July 11, 2017 10:48
Refactoring React Views, checkpoints

Refactoring view general checkpints

1. Insert // @flow

in the header of the file, in this way the flowtype binary will not ignore the file, and will statically analise it.

2. Add props types to you view.

Proptypes is deprecated in react-native, the way Facebook team is going forward is using flowtype. To specify the types of properties

@alfonsodev
alfonsodev / docker-for-mar-login
Created September 15, 2016 10:31
login into linux docker for mac
27d
I found a solution,thanks to this topic https://forums.docker.com/t/change-docker-for-mac-engine-etc-files/20102/222 , the only thing I needed to do to access the docker host was use this command:
screen ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/tty
username:root
password:[empty]
close session:Ctrl+a d
To change the swap size for oracle xe installation:
dd if=/dev/zero of=/var/swap.file count=2000000 bs=1024
# prerequisites:
sudo su
yum groupinstall "Development Tools" -y
yum install git gmp-devel postgresql-devel zlib-devel -y
# installing stack:
curl -sSL https://get.haskellstack.org/ | sh
# Download and build postgrest.
git clone https://github.com/begriffs/postgrest.git
cd postgrest
stack build --install-ghc --allow-different-user
@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 / README.md
Created May 26, 2016 18:21
deploy lambda functions with aws-lambda-deploy

mkdir lambda-test && cd lambda-test git init echo 'node_modules' >> .gitignore npm init

maybe some of these are not need , need to clean up

npm install --save-dev babel-core babel-plugin-transform-object-rest-spread babel-plugin-transform-regenerator babel-polyfill babel-preset-es2015 babel-preset-react babel-preset-stage-0 dpl

babel-polyfill as prod package

npm install babel-polyfill

create babelrc with stage-0 enabled for async/await support

@alfonsodev
alfonsodev / httpStatus.js
Created May 4, 2016 22:53
Http status code in a javascript literal object structure
// Status code list borrowed from https://golang.org/src/net/http/status.go
var http: {
100: 'CONTINUE' ,
101: 'SWITCHING_PROTOCOLS' ,
200: 'OK' ,
201: 'CREATED' ,
202: 'ACCEPTED' ,
203: 'NON_AUTHORITATIVE_INFO' ,
204: 'NO_CONTENT' ,
205: 'RESET_CONTENT' ,