Skip to content

Instantly share code, notes, and snippets.

View nicoandmee's full-sized avatar
🏠
Working from home

Nico nicoandmee

🏠
Working from home
View GitHub Profile
from cisc108 import assert_equal
def all_cats(animals):
if not animals:
return True
animalsList = animals.split(",")
# neither of the below are accepted, the 2nd seems like it definitely should be
# return False if False in ["cat" in x for x in animalsList] else True
# return all("cat" in x for x in animalsList)
const pw = require('playwright');
const UserAgent = require('user-agents');
const uuid = require('uuid');
const tmp = require('tmp-promise');
const UINT32_MAX = (2 ** 32) - 1;
const WEBGL_RENDERERS = ['ANGLE (NVIDIA Quadro 2000M Direct3D11 vs_5_0 ps_5_0)', 'ANGLE (NVIDIA Quadro K420 Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (NVIDIA Quadro 2000M Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (NVIDIA Quadro K2000M Direct3D11 vs_5_0 ps_5_0)', 'ANGLE (Intel(R) HD Graphics Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (Intel(R) HD Graphics Family Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (ATI Radeon HD 3800 Series Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (Intel(R) HD Graphics 4000 Direct3D11 vs_5_0 ps_5_0)', 'ANGLE (Intel(R) HD Graphics 4000 Direct3D11 vs_5_0 ps_5_0)', 'ANGLE (AMD Radeon R9 200 Series Direct3D11 vs_5_0 ps_5_0)', 'ANGLE (Intel(R) HD Graphics Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (Intel(R) HD Graphics Family Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (Intel(R) HD Graphics Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (Intel(R) HD Graphics Family Direct3D
async function setUAOverride(page, opts = { maskLinux: true }) {
const browser = page.context().browser();
const client = await page.context().newCDPSession(page);
// Determine the full user agent string, strip the "Headless" part
let ua = opts.userAgent || (await page.evaluate(() => navigator.userAgent)).replace('HeadlessChrome/', 'Chrome/')
if (opts.maskLinux && ua.includes('Linux') && !ua.includes('Android')) {
ua = ua.replace(/\(([^)]+)\)/, '(Windows NT 10.0; Win64; x64)') // Replace the first part in parentheses with Windows data
}
@nicoandmee
nicoandmee / pass.md
Created February 14, 2022 08:20 — forked from abtrout/pass.md
Using password-store with git repository synching

Password-store keeps your passwords (or any other sensitive information) saved in GnuPG encrypted files organized in ~/.password-store. For more information about GPG, consult the GNU Privacy Handbook.

Getting started

To get started, install pass and generate a keypair.

$ brew install pass
$ gpg --gen-key
$ gpg --list-keys
clc, clear, close all;
format long
mass = [10 20 30 40 50 60].*10^(-3);
elongation = [0.162 0.311 0.47 0.622 0.79 0.931].*10^(-2);
K = 65;
% number of samples
N = length(elongation);
#include <FastLED.h>
#include <SPI.h>
#include <String.h>
#include <Wire.h>
#pragma region PIN_DEFINITIONS
#define GAME_START 3
#define GAME_END 4
#define SLAVE_ADDR 9
#define GAME_IRQ 8
const replaceProperty = (obj, propName, descriptorOverrides = {}) => {
return Object.defineProperty(obj, propName, {
// Copy over the existing descriptors (writable, enumerable, configurable, etc)
...(Object.getOwnPropertyDescriptor(obj, propName) || {}),
// Add our overrides (e.g. value, get())
...descriptorOverrides
})
}
const replaceWithProxy = (obj, propName, handler) => {
@nicoandmee
nicoandmee / getcrx.sh
Last active July 23, 2022 22:10 — forked from bitst0rm/getcrx.sh
A bash script to download chrome extension files from Chrome Web Store
#!/usr/bin/env bash
# A bash script to download chrome extension files from Chrome Web Store
# 30.12.2018, https://github.com/bitst0rm
# 23.07.2022 https://github.com/nicoandmee
# extensions.zip contains URLs to download
if [ ! -f ./extensions.txt ]; then
echo "Missing extensions.txt file."
echo "extensions.txt should contain newline delimited list of webstore links."
{
"arrowParens": "always",
"bracketSameLine": true,
"bracketSpacing": true,
"embeddedLanguageFormatting": "auto",
"endOfLine": "lf",
"htmlWhitespaceSensitivity": "css",
"insertPragma": false,
"jsxSingleQuote": false,
"printWidth": 80,

Keybase proof

I hereby claim:

  • I am nicoandmee on github.
  • I am nicomee (https://keybase.io/nicomee) on keybase.
  • I have a public key ASCV0KNXgPBt-qJo11QwSbpH7Y_rxuEbPbYktvDU2MbOHwo

To claim this, I am signing this object: