git checkout -b feature_branch_name
git push -u origin feature_branch_name
git branch -d the_local_branch
| const puppeteer = require('puppeteer'); | |
| /************************************************** | |
| SETUP CLASS USING PROXYS FOR PUPPETEER | |
| ***************************************************/ | |
| class CustomPage { |
| /*=========================================== | |
| assertion function | |
| =============================================*/ | |
| function test(str, bool) { | |
| console.log( | |
| bool ? '\x1b[32m' : '\x1b[31m', | |
| bool ? '[PASS]' : ' [FAIL]', | |
| str | |
| ) | |
| } |
| <?php | |
| # Help | |
| php -h; | |
| # PHP ini file | |
| php -i; | |
| # Filter files | |
| php -i | grep "memory"; |
| // Form response processor set session token | |
| app.formResponseProcessor = function(formId,requestPayload,responsePayload){ | |
| var functionToCall = false; | |
| // If account creation was successful, try to immediately log the user in | |
| if(formId == 'accountCreate'){ | |
| // Take the phone and password, and use it to log the user in | |
| var newPayload = { | |
| 'phone' : requestPayload.phone, | |
| 'password' : requestPayload.password | |
| }; |
| // AJAX Client (for RESTful API) | |
| app.client = {} | |
| // Interface for making API calls | |
| app.client.request = function(headers,path,method,queryStringObject,payload,callback){ | |
| // Set defaults | |
| headers = typeof(headers) == 'object' && headers !== null ? headers : {}; | |
| path = typeof(path) == 'string' ? path : '/'; | |
| method = typeof(method) == 'string' && ['POST','GET','PUT','DELETE'].indexOf(method.toUpperCase()) > -1 ? method.toUpperCase() : 'GET'; |
| // Bind the forms | |
| app.bindForms = function(){ | |
| if(document.querySelector("form")){ | |
| var allForms = document.querySelectorAll("form"); | |
| for(var i = 0; i < allForms.length; i++){ | |
| allForms[i].addEventListener("submit", function(e){ | |
| // Stop it from submitting | |
| e.preventDefault(); |
| ## console colour out colour codes | |
| // syntax | |
| console.log("\x1b[33m%s\x1b[0m" ,"I Am Using Yellow"); | |
| console.log("\x1b[44m%s\x1b[0m" ,"Background Color Is Blue"); | |
| // variable choices | |
| Reset = "\x1b[0m" |
| # GET VERSION | |
| npm -v (or --version) | |
| # GET HELP | |
| npm help | |
| npm | |
| # CREATE PACKAGE.JSON | |
| npm init | |
| npm init -y (or --yes) |
| /* | |
| Create a function that sums two arguments together. If only one argument is provided, then return a function that expects | |
| one argument and returns the sum. | |
| For example, addTogether(2, 3) should return 5, and addTogether(2) should return a function. | |
| Calling this returned function with a single argument will then return the sum: | |
| var sumTwoAnd = addTogether(2); |