Skip to content

Instantly share code, notes, and snippets.

View sorydi3's full-sized avatar
💭
I may be slow to respond.

Diallo sorydi3

💭
I may be slow to respond.
View GitHub Profile
from langchain.chat_models import ChatOpenAI
from pydantic import BaseModel, Field
from langchain.document_loaders import UnstructuredURLLoader
from langchain.chains.openai_functions import create_extraction_chain_pydantic
class LLMItem(BaseModel):
title: str = Field(description="The simple and concise title of the product")
description: str = Field(description="The description of the product")
def main():

GitHub Search Syntax for Finding API Keys/Secrets/Tokens

As a security professional, it is important to conduct a thorough reconnaissance. With the increasing use of APIs nowadays, it has become paramount to keep access tokens and other API-related secrets secure in order to prevent leaks. However, despite technological advances, human error remains a factor, and many developers still unknowingly hardcode their API secrets into source code and commit them to public repositories. GitHub, being a widely popular platform for public code repositories, may inadvertently host such leaked secrets. To help identify these vulnerabilities, I have created a comprehensive search list using powerful search syntax that enables the search of thousands of leaked keys and secrets in a single search.

Search Syntax:

(path:*.{File_extension1} OR path:*.{File_extension-N}) AND ({Keyname1} OR {Keyname-N}) AND (({Signature/pattern1} OR {Signature/pattern-N}) AND ({PlatformTag1} OR {PlatformTag-N}))

Examples:

**1.

anonymous
anonymous / NumbersActivity.java
Created April 6, 2016 17:44
Miwok app: OnAudioFocusChangeListener declaration from NumberActivity
/**
* This listener gets triggered whenever the audio focus changes
* (i.e., we gain or lose audio focus because of another app or device).
*/
private AudioManager.OnAudioFocusChangeListener mOnAudioFocusChangeListener = new AudioManager.OnAudioFocusChangeListener() {
@Override
public void onAudioFocusChange(int focusChange) {
if (focusChange == AudioManager.AUDIOFOCUS_LOSS_TRANSIENT ||
focusChange == AudioManager.AUDIOFOCUS_LOSS_TRANSIENT_CAN_DUCK) {
// The AUDIOFOCUS_LOSS_TRANSIENT case means that we've lost audio focus for a
@Zulko
Zulko / soccer_cuts.py
Last active March 31, 2024 12:03
A python script to automatically summarize soccer videos based on the crowd's reactions
#
# This Python script makes a summary of a football game by cutting
# the video around the 10 % loudest moments, which generally
# include the goals and other important events.
# For more details, see this blog post:
# http://zulko.github.io/blog/2014/07/04/automatic-soccer-highlights-compilations-with-python/
#
# LICENCE: Creative Commons 0 - Public Domain
# I, the author of this script, wave any rights and place this work in the public domain.
#