Skip to content

Instantly share code, notes, and snippets.

import OpenAI from 'openai';
import secrets from '../secrets.json' assert {type: 'json'};
import {map, path, pipe} from "ramda";
const openai = new OpenAI({
apiKey: secrets.openai,
});
const functions = [
{
Honest Annie Privacy Policy
Last updated: June 3, 2023
1. Introduction
At Honest Annie ("us", "we", "our"), we respect your privacy and are committed to protecting it. This Privacy Policy explains our practices regarding the collection, use, and disclosure of your personal data when you use our Services and your rights in relation to that data.
2. Data We Collect
(function () {
function urlsToAbsolute(nodeList) {
if (!nodeList.length) {
return [];
}
var attrName = 'href';
if (nodeList[0].__proto__ === HTMLImageElement.prototype || nodeList[0].__proto__ === HTMLScriptElement.prototype) {
attrName = 'src';
}
nodeList = [].map.call(nodeList, function (el, i) {
const har = require('./poolstamp.json');
const fs = require('fs');
const entries = har.log.entries
.filter(el => el._initiator.type !== 'preflight')
.filter(el => el.request.url.match(/(rack-design|add-racks)/gi))
const entriesJSON = JSON.stringify(entries, null, 2);
SSH_ENV="$HOME/.ssh/environment"
function run_ssh_env {
. "${SSH_ENV}" > /dev/null
}
function start_ssh_agent {
echo "Initializing new SSH agent..."
ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}"
echo "succeeded"
@szmeku
szmeku / madridCoworks.js
Created January 15, 2021 22:24
madridCoworks.js
let coworks = require('./coworks.json')
const _ = require('ramda')
const fs = require('fs')
let output = '';
_.pipe(
_.map(
_.over(_.lensProp('tarifas'),
_.pipe(
_.filter(_.propEq('period', 'month')), _.map(_.over(_.lensProp('price'), _.pipe(
from itertools import product
from timeit import timeit
import pandas as pd
# data from https://www.cryptodatadownload.com/data/coinbase/
def profit(n, hPeriod, data):
return (data[n + hPeriod] - data[n]) / data[n]
@szmeku
szmeku / task1.py
Created July 23, 2020 16:10
gradient descent for linear regression to find formula for linear function
# todo: find functions formulas using gradient descent
# todo: check if you have
# t1 answers
# h1 = 1 2
# h2 = 10 20
import numpy as np
features = np.array([
[1, 1, 1, 1],
@szmeku
szmeku / courseraCountHours.js
Last active July 20, 2020 09:57
Coursera - count hours
const minutes = (elem) => Array.from(elem.querySelectorAll('.rc-WeekItemAnnotations'))
.map(e => e.innerText.match(/[0-9]+/)[0])
.map(e => Number(e))
.reduce((a,b) => a+b, 0)
const minutesPerSection = () => Array.from(document.querySelectorAll('.od-lesson-collection-element'))
.map(el => ({
section: el.querySelector('.card-headline-text').textContent,
minutes: minutes(el)
@szmeku
szmeku / fixFBBug.js
Last active July 17, 2020 20:57
fixFBBug.js
window.keys = {};
document.activeElement.addEventListener("keydown",
function(e){
keys[e.keyCode] = true;
console.log(JSON.stringify(keys));
if(keys[32] && keys[18]){
console.log('fafa');