This file contains 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
const extendedEuclidAlgorithm = (p, q, kv) => { | |
let out = '' | |
const Fe = (p - 1) * (q - 1) | |
let uPrev = 1, | |
vPrev = 0, | |
u = 0, | |
v = 1, | |
rPrev = kv, | |
r = Fe |
This file contains 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
class Test(): | |
# This method defines a dynamic method | |
def _method1(self, name): | |
# Creating a dynamic protected method | |
# which calls the potected `method2` | |
exec("self._%s = self._%s__method2" % (name, __class__.__name__)) | |
def __method2(self): | |
print("from method2") | |
def _method3(self): | |
# Calling a dynamically defined |
This file contains 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
var numbers = [ | |
"zero", | |
"one", | |
"two", | |
"three", | |
"four", | |
"five", | |
"six", | |
"seven", | |
"eight", |
This file contains 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
// imports ... | |
const clientSideEmotionCache = createEmotionCache(); | |
export type CustomAppProps = AppProps & { | |
Component: NextPageWithLayout<any>; | |
emotionCache?: EmotionCache; | |
}; | |
function MyApp({ Component, pageProps, emotionCache = clientSideEmotionCache }: CustomAppProps) { |
This file contains 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 { q } from 'groqd'; | |
import { useLiveQuery } from 'next-sanity/preview'; | |
import { BlogPostPage } from './BlogPost.page'; | |
type PreviewBlogPostPageProps = { | |
initialData: PostSelection; | |
}; | |
const PreviewBlogPostPage: FC<PreviewBlogPostPageProps> = ({ initialData }) => { |