Skip to content

Instantly share code, notes, and snippets.

@kaseopea
kaseopea / Money_spent_on_Aliexpress.js
Last active May 27, 2023 08:47
Count money spent on Aliexpress
/* Open /order-list page and scroll down to see all items, then paste this line in Chrome Developer Tools. */
console.log(`$${Math.ceil(Array.from(document.querySelectorAll('[class*="totalPrice"]')).reduce((acc, item) => acc + Number.parseFloat(item.textContent.replace(/[^\d\.]*/g, '')), 0))}`);
@kaseopea
kaseopea / es6_templatestrings_raw.js
Last active November 9, 2018 13:48
ES6 Katas template strings - String.raw
// 4: template strings - String.raw
// To do: make all tests pass, leave the asserts unchanged!
// Follow the hints of the failure messages!
describe('Use the `raw` property of tagged template strings like so `s.raw`', function() {
it('the `raw` property accesses the string as it was entered', function() {
function firstChar(strings) {
return strings.raw;
}
assert.equal(firstChar`\n`, '\\n');
@kaseopea
kaseopea / gist:2af805fca4ced874d4f205d6ed05ea4c
Created July 13, 2018 13:41
command is a convenient way to modify the most recent commit
git commit --amend -m "New commit message" // change latest commit message
@kaseopea
kaseopea / gist:ea7f28c23d7ce43f4b276add1e66249b
Created July 13, 2018 13:40
how to delete a git tag locally and remote
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName
Editor | General | Appearance > Show parameter name hints