Skip to content

Instantly share code, notes, and snippets.

@akimach
akimach / ipynb2docx.py
Last active October 14, 2024 14:31
Convert .ipynb to .docx
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
# Convert .ipynb to .docx
## Dependency
* Jupyter notebook
* Pandoc
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@brannondorsey
brannondorsey / sample.js
Created October 4, 2018 19:43
Discrete probability distribution sampling in JavaScript
// MIT License
//
// (c) 2018 Brannon Dorsey <[email protected]>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@sundowndev
sundowndev / GoogleDorking.md
Last active May 22, 2025 15:53
Google dork cheatsheet

Google dork cheatsheet

Search filters

Filter Description Example
allintext Searches for occurrences of all the keywords given. allintext:"keyword"
intext Searches for the occurrences of keywords all at once or one at a time. intext:"keyword"
inurl Searches for a URL matching one of the keywords. inurl:"keyword"
allinurl Searches for a URL matching all the keywords in the query. allinurl:"keyword"
intitle Searches for occurrences of keywords in title all or one. intitle:"keyword"
@ddelange
ddelange / convert_ipynb_to_py.py
Created November 20, 2019 10:15
Convert iPython Notebook (.ipynb) to a Python file (.py) from CLI
"""Convert ipynb file to py file from CLI.
Usage:
python ./convert_ipynb_to_py.py [full input path] [full output path]
!! overwrites output path without warning if it exists !!
"""
import sys
import json
@anonymousmaharaj
anonymousmaharaj / chatgpt-stable-diffusion-generate-prompt
Created April 8, 2023 21:02
Prompt for ChatGPT to generate correct prompts to SD. You can leave comment to improve it.
I want you to help me make requests (prompts) for the Stable Diffusion neural network.
Stable diffusion is a text-based image generation model that can create diverse and high-quality images based on your requests. In order to get the best results from Stable diffusion, you need to follow some guidelines when composing prompts.
Here are some tips for writing prompts for Stable diffusion1:
1) Be as specific as possible in your requests. Stable diffusion handles concrete prompts better than abstract or ambiguous ones. For example, instead of “portrait of a woman” it is better to write “portrait of a woman with brown eyes and red hair in Renaissance style”.
2) Specify specific art styles or materials. If you want to get an image in a certain style or with a certain texture, then specify this in your request. For example, instead of “landscape” it is better to write “watercolor landscape with mountains and lake".
3) Specify specific artists for reference. If you want to get an image similar to the work of some
@xec-abailey
xec-abailey / README.md
Last active April 16, 2024 08:25
ChatGPT Research Assistance Prompt

Research Assistant Prompt

This prompt provides a really responsive, interactive research assistant that will give you markdown-formatted, concise responses with code examples and optional follow-up questions. At the end of every answer it will give a list of 5 questions to continue with the topic (by using command "continue: #") or you can prompt with a completely new question.

Variables

  • PERSONA - change this to modify what type of information you want the AI to be an expert in
  • LANGUAGE - change this to modify what language the code examples are in
  • NUM_SUGGESTIONS - change this to modify number of suggested followup questions

AI-Powered Algorithmic Trading with Python

ODSC London 2023 Half-Day Training

Dr. Yves J. Hilpisch
CEO The Python Quants | The AI Machine
Adjunct Professor of Computational Finance

import os
import openai
import time
os.environ["OPENAI_API_KEY"] = <your API key>
openai.api_key = os.getenv("OPENAI_API_KEY")
# Starting templates
INQUIRY_PERSONA_starting_template = """
Act as a {INQUIRY_PERSONA}. I {TASK}.
@JustMaier
JustMaier / example.md
Created August 4, 2023 15:58
ChatGPT contextual conversation starter prompt

You are an AI Prompt engineer at OpenAI and you have just found the best prompt for effectively starting conversations with ChatGPT, an AI language model and assistant. Write an effective beggining prompt that can be used to start a conversation with ChatGPT. The prompt should:

  1. start with a persona
  2. provide relevant context for that persona to be performing the requested function
  3. Briefly outline the task they've been requested to perform
  4. Request they follow a given format
  5. Describe the tone they should use
  6. Provide them a brief example of what you're looking for Use clear and concise language and write in a confident yet friendly tone. Use this request as an example:

"You are a senior product marketing manager at Apple and you just launched the latest Apple product, the Apple Car, and received 12,000 pre-orders, which is 200% higher than target. Write an email to your boss, Tim Cooke, sharing this positive news. The email should follow the exact same format as the one I will share below. Use c