Skip to content

Instantly share code, notes, and snippets.

@jabez007
jabez007 / DailyEMA
Last active January 25, 2024 20:47
ThinkScript Studies and Strategies
input price = FundamentalType.CLOSE;
input aggregationPeriod = AggregationPeriod.DAY;
input length = 9;
input displace = 0;
input showOnlyLastPeriod = no;
plot DailyEMA;
if showOnlyLastPeriod and !IsNaN(close(period = aggregationPeriod)[-1]) {
DailyEMA = Double.NaN;
@jabez007
jabez007 / prompt.md
Last active October 14, 2023 16:20
ChatGPT Prompt for Etsy

You will now act as a title and description generator for products listed on an e-commerce platform called "Etsy". Esty hosts product listings for sale by independent crafters. I will provide you some basic examples of good product titles and descriptions found on Etsy.

Examples:

    • Title: Set of 6 Bird Pun Coasters
    • Description:
    A collection of 6 coasters, each featuring a different bird chart from the best selling ‘For the Pun of It’ collection.
    
@jabez007
jabez007 / prompt.md
Last active February 18, 2024 13:08
ChatGPT Prompt for Leonardo.ai

You will now act as a prompt generator for a generative AI called "Leonardo AI". Leonardo AI generates images based on given prompts. I will provide you basic information required to make a Stable Diffusion prompt, you will never alter the structure in any way and obey the following guidelines.

Basic information required to make Leonardo AI prompt:

  • Prompt structure:

    • Coloring Page Images prompt structure will be in this format "Subject Description in details with as much as information can be provided to describe image, Art Styles, Art Inspirations, Render Related Information"

    • Artistic Image Images prompt structure will be in this format "Type of Image, Subject Description, Art Styles, Art Inspirations, Camera, Shot, Render Related Information"

@jabez007
jabez007 / RetryHelper.cs
Created April 4, 2022 21:21
Implementing a Retry Pattern for Async Tasks in C#
using System;
using System.Linq;
using System.Threading.Tasks;
namespace Utils
{
/// <summary>
/// Expanding on the idea from https://alastaircrabtree.com/implementing-the-retry-pattern-for-async-tasks-in-c/
/// </summary>
public static class RetryHelper
exports.RateLimit = (function () {
var RateLimit = function (maxOps, interval, allowBursts) {
this._maxRate = allowBursts ? maxOps : maxOps / interval;
this._interval = interval;
this._allowBursts = allowBursts;
this._numOps = 0;
this._start = new Date().getTime();
this._queue = [];
};
@jabez007
jabez007 / opencupboard.svg
Created June 28, 2019 21:02
in the cupboard background
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jabez007
jabez007 / node-init.sh
Created June 10, 2019 17:58
How to start any new Node.js project
# https://dzone.com/articles/how-to-start-a-nodejs-project
npx license mit > LICENSE
npx gitignore node
npx covgen YOUR_EMAIL_ADDRESS
npm init
@jabez007
jabez007 / install.sh
Last active April 30, 2019 12:48
Install Vue CLI on fresh Ubuntu
#!/bin/bash
# # # #
# run as su
# $ sudo wget -O - https://gist.githubusercontent.com/jabez007/813aaa54e4a8f577aa7497a7fdd8efef/raw/b2f64c585ea4ea6936f68491459457fc10e997ec/install.sh | bash
# # # #
# make sure we have curl to start with
sudo apt-get install -y curl
@jabez007
jabez007 / randomBabylon.html
Created March 7, 2019 19:47
Using Vue-Babylon to randomly rotate a cube of cubes
<html>
<body>
<div id="app">
<Scene v-model="scene">
<Camera></Camera>
<HemisphericLight diffuse="#0000FF"></HemisphericLight>
<Entity :position="[0, 0, 0]">
<Animation property="rotation.x" :duration="duration">
<Key frame="0%" :value="0"></Key>
<Key frame="25%" :value="Math.PI * getRandom(0.25, 0.75) * getRandomInt(-1, 1)"></Key>
@jabez007
jabez007 / Stars&Score_onHover.js
Created March 6, 2019 18:11
A userscript for StockFlare that shows the individual star ratings for a stock when hovering over the stock ticker in the search results
// ==UserScript==
// @name Stars&Score onHover
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Show the StockFlare stars and StockInvest score onHover
// @author jabez007
// @match https://stockflare.com/stocks
// @grant none
// @require http://code.jquery.com/jquery-3.3.1.min.js
// @require https://cdn.jsdelivr.net/npm/vue@2.6.6/dist/vue.js