Skip to content

Instantly share code, notes, and snippets.

View esthervillars's full-sized avatar
😀

Esther Villars esthervillars

😀
  • Los Angeles, California
View GitHub Profile
@esthervillars
esthervillars / clean_code.md
Created September 10, 2019 00:46 — forked from wojteklu/clean_code.md
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

sudo openssl req \
-newkey rsa:2048 \
-x509 \
-nodes \
-keyout certificates/localhost.key \
-new \
-out certificates/localhost.crt \
-subj /CN=Hostname \
-reqexts SAN \
Reverting changes to develop or master (Rolling Forward).
To revert a merge to develop (e.g. a pull request), generate a commit that is the reverse of the pull request merge
git revert -m 1 <sha>
See example PR ...
Adding back reverted changes to develop or master
To add back reverted changes, cut a new branch and generate a patch from the original commit/merge
@esthervillars
esthervillars / gist:c3aaf3c3331de2d200eb38e9d3695efb
Created October 15, 2018 22:38
image-file-renaming-errors-prod
PHP Notice: Undefined index: sizes in /var/app/current/wp-content/plugins/s3-media-renamer/admin/class-s3-media-renamer-admin.php on line 284
PHP Warning: Invalid argument supplied for foreach() in /var/app/current/wp-content/plugins/s3-media-renamer/admin/class-s3-media-renamer-admin.php on line 285
PHP Notice: Undefined index: bucket in /var/app/current/wp-content/plugins/s3-media-renamer/admin/class-s3-media-renamer-admin.php on line 299
AWS S3 Copy Exception: The specified method is not allowed against this resource.,
PHP Notice: Undefined index: extension in /var/app/current/wp-content/plugins/s3-media-renamer/admin/class-s3-media-renamer-admin.php on line 264
PHP Warning: Illegal string offset 'key' in /var/app/current/wp-content/plugins/s3-media-renamer/admin/class-s3-media-renamer-admin.php on line 271
PHP Notice: Uninitialized string offset: 0 in /var/app/current/wp-content/plugins/s3-media-renamer/admin/class-s3-media-renamer-admin.php on line 271
PHP Warning: Illegal string offset 'key' in
@esthervillars
esthervillars / crawl.sh
Created October 12, 2018 20:52 — forked from TotalLag/crawl.sh
modified to warm up cloudflare cache
#!/bin/bash
# warmly.sh
# A wget based, easy, poor man`s cache warmer script
# https://gist.github.com/thomasfr/7926314
# The MIT License (MIT)
#
# Copyright (c) 2013,2014 Thomas Fritz <[email protected]> (http://fritzthomas.com)
#

"by Karen Casella, Phillipa Avery, Robert Reta, Joseph Breuer\n\nEarly in 2016, several Netflix teams were asked the question: “What would it take to allow members to download and view content offline on their mobile devices?”\n\nFor the Playback Licensing team, this meant that we needed to provide a content licensing system that would allow a member’s device to store and decrypt the downloaded content for offline viewing. To do this securely would require a new service to handle a complex set of yet-to-be defined business validations, along with a new API for client and server interactions. Further, we determined that this new service needed to be stateful, when all of our existing systems were stateless.\n\n“Great! How long will that take you?”\n\nIn late November 2016, nine short months after

@esthervillars
esthervillars / Install NVIDIA Driver and CUDA.md
Created June 2, 2017 20:36 — forked from wangruohui/Install NVIDIA Driver and CUDA.md
Install NVIDIA Driver and CUDA on Ubuntu / CentOS / Fedora
# Install brew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Install composer
brew install homebrew/php/composer
### PHPCS
composer global require "squizlabs/php_codesniffer=*"
# Add to your .bash_profile
@esthervillars
esthervillars / petrify.js
Created January 5, 2017 17:58 — forked from reefdog/petrify.js
Redirect a GitHub URL to the last-committed version of that thing.
/*!
* Petrify
* Redirect yourself to a permanent version of a GitHub blob or tree.
*
* Say you're looking at `https://github.com/documentcloud/documentcloud/blob/master/public/javascripts/embed/search_embed.js#L315-L317`
* and you want to link to it in an email or GitHub comment. You realize that,
* when people follow the link years or even days later, it's likely the file
* will have changed so much that those line references won't be the same, and
* people won't know what you were talking about.
*
@esthervillars
esthervillars / custom-submit.js
Created November 13, 2013 08:26 — forked from wladston/custom-submit.js
Angular JS custom submit directive
/**
* Custom submit directive that will only submit when all the validation has passed
* for all the fields. This extends on the ng-submit directive provided by AngularJS.
*
* This directive will also remove the 'pristine' flag from all the fields when
* hitting submit, allowing the form to display no errors until the submit button
* is clicked/enter is pressed.
*
* The variable 'app' is the instance of a module.
* E.g. var app = angular.module('my-app', []);