Last active
April 6, 2022 13:07
-
-
Save codenameyau/9f0a26a0f1be35a6784a to your computer and use it in GitHub Desktop.
Revisions
-
codenameyau revised this gist
Jan 19, 2020 . 1 changed file with 5 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,6 +8,11 @@ document.cookie = "token=12345; Max-Age=120; Secure; Domain=mozilla.org; Path=/; // Set a subdomain cookie. document.cookie = "name=hello world; Max-Age=120; Secure; Domain=developer.mozilla.org; Path=/;" // You can have cookies with the same name but with different paths and domains. document.cookie = "name=1; Max-Age=60; Secure; Domain=mozilla.org;" document.cookie = "name=2; Max-Age=60; Secure; Domain=mozilla.org; Path=/" document.cookie = "name=3; Max-Age=60; Secure; Domain=developer.mozilla.org; Path=/;" // Copies variable. copy(temp1) copy(JSON.stringify(temp1)) -
codenameyau revised this gist
Jan 19, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,7 +3,7 @@ *************************************************************************/ // Set top level domain cookie. document.cookie = "token=12345; Max-Age=120; Secure; Domain=mozilla.org; Path=/;" // Set a subdomain cookie. document.cookie = "name=hello world; Max-Age=120; Secure; Domain=developer.mozilla.org; Path=/;" -
codenameyau revised this gist
Jan 19, 2020 . 1 changed file with 7 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,13 @@ /************************************************************************ * CLIENT ONE-LINERS *************************************************************************/ // Set top level domain cookie. document.cookie = "name=hello world; Max-Age=120; Secure; Domain=mozilla.org; Path=/;" // Set a subdomain cookie. document.cookie = "name=hello world; Max-Age=120; Secure; Domain=developer.mozilla.org; Path=/;" // Copies variable. copy(temp1) copy(JSON.stringify(temp1)) -
codenameyau revised this gist
Jul 17, 2019 . 1 changed file with 5 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,6 +5,11 @@ copy(temp1) copy(JSON.stringify(temp1)) // Capture regex groups with variable const string = 'ayyyy lmao' const rgx = /(?<firstVowel>[aeiou])/ string.match(rgx).groups.firstVowel // Copies current selection to clipboard. // https://developer.mozilla.org/en-US/docs/Web/API/Document/execCommand // https://hackernoon.com/copying-text-to-clipboard-with-javascript-df4d4988697f -
codenameyau revised this gist
Jun 4, 2019 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -13,6 +13,9 @@ document.execCommand('copy') // Copies text content of click to clipboard. navigator.clipboard && navigator.clipboard.writeText(event.target.textContent); // Makes page text editable. document.designMode = 'on' // Access third party frames on window. window.frames -
codenameyau revised this gist
Mar 3, 2019 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,9 @@ /************************************************************************ * CLIENT ONE-LINERS *************************************************************************/ // Copies variable. copy(temp1) copy(JSON.stringify(temp1)) // Copies current selection to clipboard. // https://developer.mozilla.org/en-US/docs/Web/API/Document/execCommand -
codenameyau revised this gist
Oct 24, 2018 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,6 +7,9 @@ // https://hackernoon.com/copying-text-to-clipboard-with-javascript-df4d4988697f document.execCommand('copy') // Copies text content of click to clipboard. navigator.clipboard && navigator.clipboard.writeText(event.target.textContent); // Access third party frames on window. window.frames -
codenameyau revised this gist
Aug 14, 2018 . 1 changed file with 5 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,6 +2,11 @@ * CLIENT ONE-LINERS *************************************************************************/ // Copies current selection to clipboard. // https://developer.mozilla.org/en-US/docs/Web/API/Document/execCommand // https://hackernoon.com/copying-text-to-clipboard-with-javascript-df4d4988697f document.execCommand('copy') // Access third party frames on window. window.frames -
codenameyau revised this gist
Jun 11, 2018 . 1 changed file with 36 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,6 +6,41 @@ setTimeout(function (callback) { // Offload Heavy computation. }, 0); /******************************************************************** * JQUERY serializeArray *********************************************************************/ // Converts form into Array of Objects. // https://plainjs.com/javascript/ajax/serialize-form-data-into-an-array-46/ function serializeArray(form) { var field, l, s = []; if (typeof form == 'object' && form.nodeName == "FORM") { var len = form.elements.length; for (var i = 0; i < len; i++) { field = form.elements[i]; if (field.name && !field.disabled && field.type != 'file' && field.type != 'reset' && field.type != 'submit' && field.type != 'button') { if (field.type == 'select-multiple') { l = form.elements[i].options.length; for (j = 0; j < l; j++) { if (field.options[j].selected) s[s.length] = { name: field.name, value: field.options[j].value }; } } else if ((field.type != 'checkbox' && field.type != 'radio') || field.checked) { s[s.length] = { name: field.name, value: field.value }; } } } } return s; } // Nodejs check if module is called directly const CALLED_DIRECTLY = require.main === module; @@ -60,3 +95,4 @@ jQuery.Color.fn.contrastColor = function() { // usage examples: jQuery.Color("#bada55").contrastColor(); // "black" element.css( "color", jQuery.Color( element, "backgroundColor" ).contrastColor() ); -
codenameyau revised this gist
Jun 6, 2018 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,6 +2,9 @@ * CLIENT ONE-LINERS *************************************************************************/ // Access third party frames on window. window.frames // Create bookmark and set this to URL to skip ads. javascript:void(document.querySelector('video').currentTime = document.querySelector('video').duration) -
codenameyau revised this gist
Oct 16, 2017 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,6 +5,9 @@ // Create bookmark and set this to URL to skip ads. javascript:void(document.querySelector('video').currentTime = document.querySelector('video').duration) // See all event listeners. Remember to remove listener when unmounting. getEventListeners(document) // See Slack Emoji authors. Array.from(document.querySelectorAll('.author_cell > a')).map((a) => a.text.trim()).sort() -
codenameyau revised this gist
Sep 18, 2017 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,6 +6,9 @@ setTimeout(function (callback) { // Offload Heavy computation. }, 0); // Nodejs check if module is called directly const CALLED_DIRECTLY = require.main === module; function splitTextarea(text) { return text.trim().replace(/\s+/, '\n').replace(/\n{2,}/, '').split('\n'); } -
codenameyau revised this gist
Jun 30, 2017 . 1 changed file with 5 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,11 @@ /******************************************************************** * UTILS *********************************************************************/ // https://stackoverflow.com/q/779379 setTimeout(function (callback) { // Offload Heavy computation. }, 0); function splitTextarea(text) { return text.trim().replace(/\s+/, '\n').replace(/\n{2,}/, '').split('\n'); } -
codenameyau revised this gist
May 26, 2017 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,6 +5,9 @@ // Create bookmark and set this to URL to skip ads. javascript:void(document.querySelector('video').currentTime = document.querySelector('video').duration) // See Slack Emoji authors. Array.from(document.querySelectorAll('.author_cell > a')).map((a) => a.text.trim()).sort() // Use this to click all links. Array.from(document.querySelectorAll('a.block')).forEach(a => a.click()) -
codenameyau revised this gist
May 17, 2017 . 1 changed file with 0 additions and 39 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -52,42 +52,3 @@ jQuery.Color.fn.contrastColor = function() { // usage examples: jQuery.Color("#bada55").contrastColor(); // "black" element.css( "color", jQuery.Color( element, "backgroundColor" ).contrastColor() ); -
codenameyau renamed this gist
May 17, 2017 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
codenameyau renamed this gist
May 17, 2017 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
codenameyau revised this gist
May 17, 2017 . 1 changed file with 0 additions and 97 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,97 +0,0 @@ -
codenameyau revised this gist
May 3, 2017 . 2 changed files with 2 additions and 20 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ // Checks if nested property exists. db.drafts.find({"collection_type": "web_advertising", "email": "jorge@email.com", "rows.222": { $exists: true } }); // Grabs the count. db.drafts.find({"email": "jorge@email.com"}).count(); This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,18 +0,0 @@ -
codenameyau revised this gist
Apr 12, 2017 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -14,6 +14,9 @@ Array.from(document.images).forEach(img => console.log(img.getAttribute('src'))) // Like all facebook posts. Array.from(document.body.querySelectorAll('.UFILikeLink')).forEach((a) => a.click()) // Selecting wildcard classes. Array.from(document.querySelectorAll('div[class^="ManageSection__column-left"] .dp-checkbox')).forEach((a) => a.click()) /************************************************************************ * SERVER ONE-LINERS *************************************************************************/ -
codenameyau revised this gist
Mar 9, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -36,7 +36,7 @@ function dataURItoBlob(dataURI) { } function resizeWidth(file, max_width, callback) { max_width = max_width || 600; // Read image from file system and resize. var reader = new FileReader(); -
codenameyau revised this gist
Feb 17, 2017 . 1 changed file with 9 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -31,6 +31,15 @@ encodeURIComparison = function() { console.table(arr); }; function encodeQueryParams (url, queryParams) { return Object.keys(queryParams).reduce((a, key) => { a.push(key + '=' + encodeURIComponent(queryParams[key])); return a; }, []).join('&'); } let queryString = encodeQueryParams(queryParams); url += url.indexOf('?') > -1 ? '&' : '?' + queryString; /******************************************************************** * JQUERY COLOR CONTRAST -
codenameyau revised this gist
Feb 8, 2017 . 1 changed file with 18 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ /******************************************************************** * NESTED REDUCERS *********************************************************************/ var x = { name: 'Sabbir', same: 'name', skillz: { awesomeness: false, dbStuffs: false } }; var y = { name: 'Sabbeez', skillz: { awesomeness: true } }; // First extend flat props, then extended the nested skillz. var z = {...x, ...y, skillz: {...x.skillz, ...y.skillz}}; console.log(z); -
codenameyau revised this gist
Feb 7, 2017 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,6 +2,9 @@ * CLIENT ONE-LINERS *************************************************************************/ // Create bookmark and set this to URL to skip ads. javascript:void(document.querySelector('video').currentTime = document.querySelector('video').duration) // Use this to click all links. Array.from(document.querySelectorAll('a.block')).forEach(a => a.click()) -
codenameyau revised this gist
Dec 16, 2016 . 1 changed file with 10 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,6 +5,16 @@ function splitTextarea(text) { return text.trim().replace(/\s+/, '\n').replace(/\n{2,}/, '').split('\n'); } // Download using fetch API.. import download from 'downloadjs'; const handleBufferDownload = (filename) => { res.arrayBuffer() .then((buffer) => { download(buffer, filename, contentType); stopLoading(); }); }; // http://stackoverflow.com/a/23842171 encodeURIComparison = function() { var arr = []; -
codenameyau revised this gist
Dec 4, 2016 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,6 +8,8 @@ Array.from(document.querySelectorAll('a.block')).forEach(a => a.click()) // Grab all the images from a page (namely instagram) Array.from(document.images).forEach(img => console.log(img.getAttribute('src'))) // Like all facebook posts. Array.from(document.body.querySelectorAll('.UFILikeLink')).forEach((a) => a.click()) /************************************************************************ * SERVER ONE-LINERS -
codenameyau revised this gist
Nov 14, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,7 @@ * CLIENT ONE-LINERS *************************************************************************/ // Use this to click all links. Array.from(document.querySelectorAll('a.block')).forEach(a => a.click()) // Grab all the images from a page (namely instagram) -
codenameyau revised this gist
Nov 14, 2016 . No changes.There are no files selected for viewing
-
codenameyau revised this gist
Nov 14, 2016 . 1 changed file with 11 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,17 @@ /************************************************************************ * CLIENT ONE-LINERS *************************************************************************/ // Use this to click all selected elements. Array.from(document.querySelectorAll('a.block')).forEach(a => a.click()) // Grab all the images from a page (namely instagram) Array.from(document.images).forEach(img => console.log(img.getAttribute('src'))) /************************************************************************ * SERVER ONE-LINERS *************************************************************************/ // Use Now to deploying static app serving a single page app. ns ./build --cmd 'list ./content -s' -
codenameyau revised this gist
Nov 10, 2016 . 1 changed file with 6 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,6 @@ // Use this to click all selected elements. Array.from(document.querySelectorAll('a.block')).forEach(a => a.click()) // Grab all the images from a page (namely instagram) Array.from(document.images).forEach(img => console.log(img.getAttribute('src')))
NewerOlder