add this line
client_max_body_size 20M;
to this file
/path/to/vagrant-lamp/ansible/roles/Nginx/templates/nginx.conf.j2
in the 'http' section
add this line
client_max_body_size 20M;
to this file
/path/to/vagrant-lamp/ansible/roles/Nginx/templates/nginx.conf.j2
in the 'http' section
most, but not all (notably sort
and reverse
on arrays) methods on arrays and strings will not modify the string or array
for example
var myString = 'qwerty';
console.log(myString.split('')); // ['q','w','e','r','t','y']
console.log(myString); // 'qwerty'
myString.toUpperCase();
At some point in time I'm sure every programmer has said (/thought/mumbled/screamed) this. I know I have on way too many occasions. It's important to know that everyone has this problem, and at times, this can be extremely frustrating.
I'd like to share with you my own personal debugging process. I'll be using JavaScript as an example here, but these ideas I'm sure can apply to coding in general.
Note: This all totally works for me, individual results may vary, use at your own risk, none of these statements are verfied by the FDA or any other relevant government agency.
Before I start (usually metaphorically, sometimes literally) banging my head on the wall, this is what I ask myself:
JavaScript
var display = document.getElementById("inner-display");
var inputBtns = document.getElementsByClassName("input-btn");
var clearBtn = document.getElementById("clear");
var equalsBtn = document.getElementById("equals");
var spaceBtn = document.getElementById("space");
var binaryBtn = document.getElementById("binary");
var hexBtn = document.getElementById("hex");
The awesomeness of jQuery comes from it's ability to let us use CSS selectors to manipulate the DOM. Almost and CSS selector you had previously used for styling you can use to grab HTML elements with jQuery.
We can use jQuery to manipulate multiple elements at the same time. For example:
HTML
lorem ipsum
[1,2,3,4,5].forEach(function(e, i){ | |
setTimeout(function(){ | |
console.log(e); | |
}, 1000 * i); | |
}); |
function sample(array){ | |
return array[Math.floor(Math.random() * array.length)]; | |
} | |
/** | |
* colorize and individual color functions adapted from | |
* https://kpumuk.info/ruby-on-rails/colorizing-console-ruby-script-output/ | |
*/ | |
function colorize(text, code){ | |
return '\033[' + code + 'm' + text + '\033[0m'; |
Check out this gist for the code!
This simple simon is written in javascript and designed for the command line, so you must have node installed to run it.
Note for all codeup students: your vagrant box totally has node already installed.