Skip to content

Instantly share code, notes, and snippets.

View koolamusic's full-sized avatar
🎯
Focusing

U.M Andrew koolamusic

🎯
Focusing
View GitHub Profile
@svpino
svpino / llama2-monsterapis.py
Last active August 14, 2023 17:36
Llama 2 - MonsterAPIs.
import requests
import json
from time import sleep
API_KEY = "INSERT YOUR API KEY HERE"
AUTHORIZATION = "INSERT YOUR AUTHORIZATION TOKEN HERE"
url = "https://api.monsterapi.ai/apis/add-task"
fetch_url = "https://api.monsterapi.ai/apis/task-status"
# coding=utf-8
# Copyright 2023 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@mikeknapp
mikeknapp / remove_insta_followers.js
Created January 18, 2023 04:48
Remove certain instagram followers in bulk
/*
Adapted from https://gist.github.com/adminy/5e80c40592b135e6d7fd8e6bd88c825a
Use something like https://gist.github.com/abir-taheer/0d3f1313def5eec6b78399c0fb69e4b1#file-instagram-follower-following-js to get the list of
users to unfollow.
Instructions:
1. Open: https://www.instagram.com/{YOUR_USERNAME}/following/ in your web browser <-- replace
{YOUR_USERNAME} with your username
2. Edit the `usersToUnfollow` array below to contain the usernames of the people you want
const randInt = (min, max) => Math.floor(Math.random() * (max - min + 1) + min) // min and max included
const sleep = ms => new Promise(resolve => setTimeout(resolve, ms))
const followersElement = getFollowersElementWithUsername(getUsername())
followersElement.click()
function getUsername () {
const pageTitleElement = document.getElementsByTagName('h2')[0]
if (!pageTitleElement) throw new Error('No title to get username from')
return pageTitleElement.innerHTML
@deckchairlabs
deckchairlabs / filters.js
Created May 17, 2021 03:04
Prisma Custom Generator
#!/usr/bin/env node
const path = require('path')
const generatorHelper = require('@prisma/generator-helper')
const { Project, StructureKind, VariableDeclarationKind } = require('ts-morph')
generatorHelper.generatorHandler({
onManifest(config) {
return {
prettyName: 'Filters',
defaultOutput: path.resolve(__dirname, 'filters'),
@koolamusic
koolamusic / stringToHsl.js
Last active February 28, 2021 10:06
Convert a String to HSL Color
// Based on HSL. Generate an Abritrary pastel tone color based on input text.
/*
1. s = saturation
2. l = lightness
*/
function stringToHslColor(str, s=30, l=80) {
const hash = 0;
for (let i = 0; i < str.length; i++) {
hash = str.charCodeAt(i) + ((hash << 5) - hash);
@nagavinodcse
nagavinodcse / alpinejs-carousel-using-swiper-tailwindcss.markdown
Created December 25, 2020 15:59
AlpineJS Carousel using Swiper + Tailwindcss
@bajcmartinez
bajcmartinez / erc20-token-sample.sol
Last active October 13, 2023 22:58
Necessary code to generate an ERC20 Token
pragma solidity ^0.4.24;
// ----------------------------------------------------------------------------
// Sample token contract
//
// Symbol : LCST
// Name : LCS Token
// Total supply : 100000
// Decimals : 2
// Owner Account : 0xde0B295669a9FD93d5F28D9Ec85E40f4cb697BAe
@michaelbourne
michaelbourne / functions.php
Last active August 18, 2023 20:18
Dynamic OG images for WordPress using Microlink
<?php
/**
* The following goes in your child theme's functions.php file
*/
/**
* Generate custom Open Graph images for your blog posts
*
* @param string $url URL of OG image in HTML Meta.
const createDelegateBySigMessage = (compAddress, delegatee, expiry = 10e9, chainId = 1, nonce = 0) => {
const types = {
EIP712Domain: [
{ name: 'name', type: 'string' },
{ name: 'chainId', type: 'uint256' },
{ name: 'verifyingContract', type: 'address' },
],
Delegation: [
{ name: 'delegatee', type: 'address' },
{ name: 'nonce', type: 'uint256' },