Skip to content

Instantly share code, notes, and snippets.

View karelin's full-sized avatar

Nikolay Karelin karelin

View GitHub Profile
@harmakit
harmakit / gist:dfb54d833e20e05c9aac9ef0241742e8
Created December 14, 2023 17:16
Obsidian Clipper Bookmarklet – Safari (both desktop and mobile)
0. Install "Obsidian Advanced URI" plugin and (optionally) "Local Images Plus" to save images from clipped pages locally
1. Create bookmark with from any url
2. Edit address to:
```
javascript:(function()%7B%2F*%20Optional%20vault%20name%20*%2F%0Aconst%20vault%20%3D%20%22%22%3B%0A%0A%2F*%20Optional%20folder%20name%20such%20as%20%22Clippings%2F%22%20*%2F%0Aconst%20folder%20%3D%20%22%2B%2F%D0%A1%D0%BE%D1%85%D1%80%D0%B0%D0%BD%D0%B5%D0%BD%D0%BD%D0%BE%D0%B5%2F%22%3B%0A%0A%2F*%20Optional%20tags%20%20*%2F%0Alet%20tags%20%3D%20%22clippings%22%3B%0A%0A%0A%0A%2F*%0A%20*%0A%20*%20Embed%20turndown%406.0.0%20to%20work%20around%20content%20security%20policies%20breaking%20import%20statements%0A%20*%0A%20*%2F%0A%0Afunction%20extend%20(destination)%20%7B%0A%20%20for%20(var%20i%20%3D%201%3B%20i%20%3C%20arguments.length%3B%20i%2B%2B)%20%7B%0A%20%20%20%20var%20source%20%3D%20arguments%5Bi%5D%3B%0A%20%20%20%20for%20(var%20key%20in%20source)%20%7B%0A%20%20%20%20%20%20if%20(source.hasOwnProperty(key))%20destination%5Bkey%5D%20%3D
@veekaybee
veekaybee / normcore-llm.md
Last active November 18, 2024 19:40
Normcore LLM Reads

Anti-hype LLM reading list

Goals: Add links that are reasonable and good explanations of how stuff works. No hype and no vendor content if possible. Practical first-hand accounts of models in prod eagerly sought.

Foundational Concepts

Screenshot 2023-12-18 at 10 40 27 PM

Pre-Transformer Models

@cquangc
cquangc / app.py
Created June 30, 2023 05:26 — forked from vovavili/app.py
Streamlit + Firebase authorization example
"""Module for handling authentication, interactions with Firebase and JWT cookies.
This solution is refactored from the ‘streamlit_authenticator’ package . It leverages JSON
Web Token (JWT) cookies to maintain the user’s login state across browser sessions. For the
backend, It uses Google’s Firebase Admin Python SDK. This solution ensures that the content
of the page and user settings panel are only displayed if the user is authenticated. Similarly,
the login page can only be accessed if the user is not authenticated. Upon registration, the
user is sent a verification link to their e-mail address.
Important - to make this app run, put the following variables in your secrets.toml file:
COOKIE_KEY - a random string key for your passwordless reauthentication
@DeNeutoy
DeNeutoy / app.py
Created February 17, 2020 17:41
scispacy demo
import streamlit as st
import spacy
from spacy import displacy
import pandas as pd
from scispacy.umls_linking import UmlsEntityLinker
from scispacy.abbreviation import AbbreviationDetector
SPACY_MODEL_NAMES = ["en_core_sci_sm", "en_core_sci_md", "en_core_sci_lg"]
@harshitsinghai77
harshitsinghai77 / app.js
Created December 23, 2019 14:10
GitHub Organization API: Get the number of stars for a github organization repository using Node.js
// Basic Routes libraries
const express = require('express');
const app = express();
const bodyParser = require('body-parser');
const cors = require('cors');
const axios = require('axios');
//Logging
const pino = require('pino')("./logs/info.log");;
const expressPino = require("express-pino-logger")({
@asanakoy
asanakoy / Scrape with proxy
Created October 12, 2018 19:11
How to scrape data fwom awebsite through proxies
#Proxy list graper
# https://github.com/abdallahelsokary/Proxy-Collector-/blob/master/Proxy_Collector.py
import urllib.request
import urllib.error
import time
def proxy_list():
try:
@FND
FND / README.md
Last active August 30, 2024 04:42
Falcon WSGI application with asyncio

Getting Started

$ pip install falcon
$ python3 app.py

alternatively with Gunicorn (for HTTP/1.1):

$ pip install gunicorn

$ gunicorn app:app

@jasonrudolph
jasonrudolph / gist:6057563
Last active September 22, 2024 12:54
GitHub Search API: Get the number of stars for a repository

James Sugrue [asked][1], "@GitHubAPI is there a way to find the number of stars for a given repository?"

Example

$ curl -ni "https://api.github.com/search/repositories?q=more+useful+keyboard" -H 'Accept: application/vnd.github.preview'
{
@passos
passos / Dumper.py
Last active March 24, 2023 02:55
A perl Data.Dumper clone for Python
"""
A perl Data.Dumper clone for Python
Author: [email protected]
2011-07-08
Copyright 2011 Jinyu LIU
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:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.