Skip to content

Instantly share code, notes, and snippets.

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

Francisco Cordova Rios fecori

🏠
Working from home
View GitHub Profile
@fecori
fecori / .eslintrc
Created March 1, 2019 17:33 — forked from cletusw/.eslintrc
ESLint Reset - A starter .eslintrc file that resets all rules to off and includes a description of what each rule does. From here, enable the rules that you care about by changing the 0 to a 1 or 2. 1 means warning (will not affect exit code) and 2 means error (will affect exit code).
{
// http://eslint.org/docs/rules/
"ecmaFeatures": {
"binaryLiterals": false, // enable binary literals
"blockBindings": false, // enable let and const (aka block bindings)
"defaultParams": false, // enable default function parameters
"forOf": false, // enable for-of loops
"generators": false, // enable generators
"objectLiteralComputedProperties": false, // enable computed object literal property names
@fecori
fecori / mraid.js
Created November 6, 2018 15:51 — forked from bensojona/mraid.js
/*
Do not modify this version of the file. It will be copied over when any of the project's targets are built.
If you wish to modify mraid.js, modify the version located at mopub-sdk-common/mraid/mraid.js.
*/
(function() {
var isIOS = (/iphone|ipad|ipod/i).test(window.navigator.userAgent.toLowerCase());
if (isIOS) {
console = {};
console.log = function(log) {
var iframe = document.createElement('iframe');
@fecori
fecori / smooth-scroll.js
Created October 9, 2018 15:16 — forked from javiercastrodev/smooth-scroll.js
Simple smooth-scroll animation in pure/vanilla javascript
/**
* Smooth scroll animation
* @param {int} endX: destination x coordinate
* @param {int) endY: destination y coordinate
* @param {int} duration: animation duration in ms
*/
window.smoothScrollTo = function(endX, endY, duration) {
var startX = window.scrollX || window.pageXOffset,
startY = window.scrollY || window.pageYOffset,
distanceX = endX - startX,
@fecori
fecori / dezip.js
Created September 4, 2018 23:18 — forked from miguelmota/dezip.js
Uncompress gzip response body in Node.js
var request = require('request');
var zlib = require('zlib');
request(url, {encoding: null}, function(err, response, body){
if(response.headers['content-encoding'] == 'gzip'){
zlib.gunzip(body, function(err, dezipped) {
callback(dezipped.toString());
});
} else {
callback(body);
cleanKey(path) {
// console.log('test', path.split('/'));
// console.log('test', path.split('/').slice(-1));
let arrayPath = path.split('/');
let lastItem = arrayPath.slice(-1);
let extension = lastItem.toString().split('.');
let url = extension[0].toString().toLowerCase()
.replace(/\s+/g, '-')
.replace(/[^\w\-]+/g, '')
.replace(/\-\-+/g, '-')

Free O'Reilly books and convenient script to just download them.

Thanks /u/FallenAege/ and /u/ShPavel/ from this Reddit post

How to use:

  1. Take the download.sh file and put it into a directory where you want the files to be saved.
  2. cd into the directory and make sure that it has executable permissions (chmod +x download.sh should do it)
  3. Run ./download.sh and wee there it goes. Also if you do not want all the files, just simply comment the ones you do not want.
@fecori
fecori / bitbucket-pipelines.yml
Created January 30, 2018 19:30 — forked from stevenquiroa/bitbucket-pipelines.yml
Bitbucket-pipelines, ssh, git-ftp
#Imagen con debian y git para el container.
#Se utiliza especificamente esta porque git-ftp necesita el paquete de git para funcionar
#Declaramos la imagen a utilizar
image: samueldebruyn/debian-git
#Iniciamos el pipeline
pipelines:
default:
- step:
@fecori
fecori / install-laravel.sh
Created August 24, 2017 22:30 — forked from bigbeno37/install-laravel.sh
Install Laravel 5.4, MySQL 5.7, Apache2.4 and PHP7.1 on Ubuntu 16.04
# CREATED BY BEN O'SULLIVAN / BIGBENO37 (GITHUB.COM/BIGBENO37)
# LICENSED UNDER CREATIVE COMMONS 'Attribution 4.0 International' LICENSE
# https://creativecommons.org/licenses/by/4.0/
# FEEL FREE TO USE AND ADAPT THIS SCRIPT IN COMMERCIAL AND NON COMMERICAL PRODUCTS
# AS LONG AS PROPER ACCREDITATION IS GIVEN
# VARIABLES
echo -e "\x1B[01;95mWhat would you like to name your Laravel project?\x1B[0m"
read LARAVEL_PROJECT_NAME
@fecori
fecori / ReactJS-Server-Side-Rendering.md
Created June 30, 2017 16:22 — forked from koistya/ReactJS-Server-Side-Rendering.md
Server-side Rendering (SSR) for ReactJS / Flux Applications. Setting document.title

Files

The basic structure of a React+Flux application (see other examples)

 - /src/actions/AppActions.js     - Action creators (Flux)
 - /src/components/Application.js - The top-level React component
 - /src/constants/ActionTypes.js  - Action types (Flux)
 - /src/core/Dispatcher.js        - Dispatcher (Flux)
 - /src/stores/AppStore.js        - The main store (Flux)
@fecori
fecori / .htaccess
Created May 12, 2017 21:41 — forked from ankurk91/.htaccess
Some .htaccess tips and tricks
# Source internet
# Use at your own risk, test on localhost first
# Ovrride Default index.php
DirectoryIndex home.php
# Prevent access to some files
<FilesMatch "^(wp-config.php|readme.html|license.txt|README.md|.gitignore|.gitattributes|.htaccess|error_log)">
Order allow,deny
Deny from all