Skip to content

Instantly share code, notes, and snippets.

View alfonsodev's full-sized avatar
🏠

Alfonso alfonsodev

🏠
View GitHub Profile
@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 / 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 / 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' ,
@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 / 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
# 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 / 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
@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

body {
padding-top: 120px;
padding-bottom: 40px;
background-color: #eee;
}
.container {
width: 50%;
}
.btn
{
@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.