Skip to content

Instantly share code, notes, and snippets.

View made-by-chris's full-sized avatar
🏁

Christopher Shelley made-by-chris

🏁
View GitHub Profile
@made-by-chris
made-by-chris / mongo db aggregation hmmmm
Created February 3, 2022 19:38
some fun aggregations
db.listingsAndReviews.aggregate([ { "$project": { "address": 1, "_id": 0 } }, { "$group": { "_id": "$address.country", "sum": { "$sum": 1 } } }])
db.listingsAndReviews.aggregate([ { "$project": { "address": 1, "_id": 0 } }, { "$group": { "_id": "$address.country", "sum": { "$sum": 5 } } },{ "$sort" : { "sum" : 1 } } ])
@made-by-chris
made-by-chris / pastemeintothevaultprompt.js
Created February 26, 2021 14:28
extract passwords from lastpass browser plugin when you forget master password
const timeout = (ms) => new Promise((res) => setTimeout(res, ms));
const items = document.querySelectorAll(".itemWrapper");
console.log(
`duration: ${
items.length * 4
} seconds. password info will be copied to your clipboard (like copy/paste)`
);
const res = [];
async function go(i) {
var newItem = {};
@made-by-chris
made-by-chris / .block
Created September 18, 2019 10:27 — forked from gkhays/.block
Oscillating Sine Wave Rendered with JavaScript
license: cc-by-4.0
@made-by-chris
made-by-chris / .block
Last active September 18, 2019 10:31 — forked from gkhays/.block
Oscillating Sine Wave Rendered with JavaScript
license: cc-by-4.0
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style id="jsbin-css">
body {
margin: 0;
overflow: hidden;
com
net
org
us
gdn
co
in
info
xyz
top
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body {
margin: 0;
padding: 0;
}
nav {
#!/usr/bin/bash
get_six_hours() {
six_hours=:initially-not-a-number:
((six_hours = 21600))
}
kill_in_six_hours() {
for ((; ;)); do
get_six_hours
const fm = (() => {
const model = {}
let observers = { fm_observe_all : [] }
function sub (key, observerCallback) {
if (typeof observers[key] === 'undefined') {
observers[key] = []
}
if (!observers[key].includes(observerCallback)) {
observers[key].push(observerCallback)