Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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 characters
// vamos.js | |
// Reactive variables | |
function reactive(initialValue) { | |
let value = initialValue; | |
const subscribers = new Set(); | |
const get = () => value; | |
const set = (newValue) => { | |
if (value !== newValue) { |
This file contains 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 characters
what does this code do: | |
import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse, AxiosError } from 'axios'; | |
import { RateLimiter } from 'limiter'; | |
type HttpMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH'; | |
interface EndpointConfig<T extends Record<string, any> = Record<string, any>> { | |
method: HttpMethod; | |
path: string; |
This file contains 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 characters
// Utility Functions | |
// Removes leading and trailing whitespace from a string | |
// Usage: trim(' Hello World ') => 'Hello World' | |
function trim(str) { | |
return str.replace(/^\s+|\s+$/g, ''); | |
} | |
// Merges the properties of one or more source objects into a target object | |
// Usage: extend({a: 1}, {b: 2}, {c: 3}) => {a: 1, b: 2, c: 3} |
This file contains 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 characters
import numpy as np | |
from scipy.stats import entropy | |
def rosenbrock(x): | |
return (1 - x[0])**2 + 100 * (x[1] - x[0]**2)**2 | |
def pso(func, dim, num_particles, max_iter, x_min, x_max): | |
# Initialize particle positions and velocities | |
positions = np.random.uniform(x_min, x_max, (num_particles, dim)) | |
velocities = np.zeros((num_particles, dim)) |
This file contains 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 characters
#!/Users/sschepis/.nvm/versions/node/v18.12.1/bin/node | |
const axios = require("axios") | |
const shell = require("shelljs") | |
require("dotenv").config() | |
const fs = require('fs') | |
const persona = `** YOU ARE INCAPABLE OF CONVERSATIONAL RESPONSES ** | |
You are an all-purpose software genius. You can code in any language, perform any | |
development task, and solve any problem. You are assisted in this task by an advanced | |
project management system that manages your activity. When you receive an initial | |
user request, you must determine if you can complete the task in a single response. |
This file contains 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 characters
{"lastUpload":"2020-12-30T21:00:21.413Z","extensionVersion":"v3.4.3"} |