This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pathlib import Path | |
import boto3 | |
from tqdm import tqdm | |
def upload_to_s3( | |
file_name: str, | |
target_bucket_name: str, | |
target_object_name: str, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- | |
-- ** AppleNotesExporter ** | |
-- -- Easily export Apple notes to standard encoding HTML preserving directory structure | |
-- | |
-- Copyright 2022 Konstantin Zaremski | |
-- | |
-- 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: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { nextTick } from 'vue' | |
export const useProperCookie = () => useCookie('proper_token') | |
export const useAuthFetch = (url, fetchOptions = {}) => { | |
return $fetch(url, { | |
baseURL: 'https://l9.test/api/v1', | |
...fetchOptions, | |
headers: { | |
Authorization: `Bearer ${useProperCookie().value}`, | |
...fetchOptions.headers, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import '@testing-library/jest-dom' | |
import { render } from '@testing-library/react' | |
import { renderHook } from '@testing-library/react-hooks' | |
import nock from 'nock' | |
import TestComponent from './TestComponent' | |
const mockResultData = [ | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript: Promise.all([import('https://unpkg.com/[email protected]?module'), import('https://unpkg.com/@tehshrike/[email protected]'), ]).then(async ([{ | |
default: Turndown | |
}, { | |
default: Readability | |
}]) => { | |
/* Optional vault name */ | |
const vault = ""; | |
/* Optional folder name such as "Clippings/" */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.test import TestCase | |
from django.contrib import auth | |
class BaseAuthTestCase(TestCase): | |
def assertLoggedInAs(self, user): | |
client_user = auth.get_user(self.client) | |
self.assertEqual(client_user, user) | |
assert client_user.is_authenticated() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* | |
Script - Comments | |
@author - Nayan Seth | |
© Tech Barrack Solutions Pvt Ltd | |
*) | |
--This is a single line comment | |
#This is a comment too but still single line | |
(* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
requests.post("https://api.mailgun.net/v2/DOMAIN/messages", | |
auth=("api", "key-SECRET"), | |
files={ | |
"attachment[0]": ("FileName1.ext", open(FILE_PATH_1, 'rb')), | |
"attachment[1]": ("FileName2.ext", open(FILE_PATH_2, 'rb')) | |
}, | |
data={"from": "FROM_EMAIL", | |
"to": [TO_EMAIL], | |
"subject": SUBJECT, | |
"html": HTML_CONTENT |