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
| /* | |
| * Copyright 2025 Duolingo, Inc. | |
| * | |
| * Licensed under the Apache License, Version 2.0 (the "License"); | |
| * you may not use this file except in compliance with the License. | |
| * You may obtain a copy of the License at | |
| * | |
| * http://www.apache.org/licenses/LICENSE-2.0 | |
| * | |
| * Unless required by applicable law or agreed to in writing, software |
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
| ;; Dual header line is possible by exploiting the tab-bar line that | |
| ;; sits on top of the header line and is generally hidden. For the | |
| ;; icon, it has to be precisely cut in top and bottom part and each | |
| ;; part is concatenated with either the tab-line or header-line. | |
| (defun dual-header (top bottom) | |
| "This installs a double line header in current buffer using both tab line (TOP) and header line (BOTTOM)." | |
| (set-face-attribute 'tab-line (selected-frame) |
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
| class WifiNetworksFragment : TonalFragment(R.layout.wifi_networks_fragment) { | |
| // This automatically creates and clears the binding in a lifecycle-aware way. | |
| private val binding: WifiNetworksFragmentBinding by viewBinding() | |
| ... | |
| } | |
| class WifiNetworkView @JvmOverloads constructor( | |
| context: Context, | |
| attrs: AttributeSet? = null, |
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 kotlinx.coroutines.CoroutineScope | |
| import kotlinx.coroutines.Job | |
| import kotlinx.coroutines.delay | |
| import kotlinx.coroutines.launch | |
| /* | |
| This is free and unencumbered software released into the public domain. | |
| Anyone is free to copy, modify, publish, use, compile, sell, or | |
| distribute this software, either in source code form or as a compiled |
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
| (defun org-mode-export-myfile () | |
| "Export org document to HTML automatically on change" | |
| (when (equal (buffer-file-name) "/path/to/links.org") | |
| (progn | |
| (org-html-export-to-html) | |
| (message "HTML exported")))) | |
| (add-hook 'after-save-hook 'org-mode-export-myfile) |
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
| ;; Moved to dedicated repo: https://github.com/alphapapa/snow.el |
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
| #!/bin/sh | |
| STAGED_GO_FILES=$(git diff --cached --name-only | grep ".go$") | |
| if [[ "$STAGED_GO_FILES" = "" ]]; then | |
| exit 0 | |
| fi | |
| GOLINT=$GOPATH/bin/golint | |
| GOIMPORTS=$GOPATH/bin/goimports |
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
| export function imageFileToDataUri (file: File) { | |
| return new Promise<string>(done => { | |
| const reader = new FileReader() | |
| reader.onloadend = () => done(reader.result) | |
| reader.readAsDataURL(file) | |
| }) | |
| } | |
| export function imageSrcToImageData (imageSrc: string) { | |
| return new Promise<ImageData>(resolve => { |
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
| declare module 'react-svg-pan-zoom' { | |
| import * as React from 'react' | |
| type Tool = 'auto' | 'none' | 'pan' | 'zoom-in' | 'zoom-out' | |
| type ToolBarPosition = 'none' | 'top' | 'right' | 'bottom' | 'left' | |
| export const ReactSVGPanZoom: ReactSVGPanZoom | |
| interface ReactSVGPanZoom extends React.ComponentClass<ReactSVGPanZoomProps> {} |
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
| public class AnnotationHelper { | |
| private static final String ANNOTATIONS = "annotations"; | |
| public static final String ANNOTATION_DATA = "annotationData"; | |
| public static boolean isJDK7OrLower() { | |
| boolean jdk7OrLower = true; | |
| try { | |
| Class.class.getDeclaredField(ANNOTATIONS); | |
| } catch (NoSuchFieldException e) { | |
| //Willfully ignore all exceptions |
NewerOlder