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
| // language=GLSL | |
| const VERTEX_SHADER_SOURCE = /*glsl*/ ` | |
| attribute vec4 a_id; | |
| attribute vec4 a_color; | |
| attribute vec2 a_position; | |
| attribute float a_size; | |
| attribute float a_angle; | |
| attribute vec4 a_texture; | |
| attribute float a_texture_index; |
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 type { Attributes } from "graphology-types"; | |
| import { NodeProgram } from "sigma/rendering"; | |
| import type { Sigma } from "sigma"; | |
| import type { | |
| NodeHoverDrawingFunction, | |
| NodeLabelDrawingFunction, | |
| NodeProgramType, | |
| ProgramInfo | |
| } from "sigma/rendering"; | |
| import type { NodeDisplayData, RenderParams } from "sigma/types"; |
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 { EventEmitter } from "events"; | |
| /** | |
| * Useful types: | |
| * ************* | |
| */ | |
| export type ImageState = { | |
| image: HTMLImageElement; | |
| status: "loading" | "ready" | "error" | "drawn"; | |
| x: number; |
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
| # Colors | |
| set -g default-terminal "screen-256color" | |
| # New prefix | |
| set-option -g prefix C-b | |
| set-option -g prefix C-q | |
| # Enable mouse | |
| set -g mouse on |
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
| // Insert using sql.DB with transaction | |
| func InsertPage(db *sql.DB, url string, content string) error { | |
| // Open transaction | |
| tx, err := db.Begin() | |
| if err != nil { | |
| return err | |
| } |
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
| /** | |
| * Sigma.js WebGL Renderer Node Program | |
| * ===================================== | |
| * | |
| * Program rendering nodes using GL_POINTS, but that draws an image on top of | |
| * the classic colored disc. | |
| * @module | |
| */ | |
| // import { Coordinates, Dimensions, NodeDisplayData } from "../../../types"; | |
| // import { floatColor } from "../../../utils"; |
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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Image Loading Optimisation</title> | |
| <style> | |
| figure.zoom { | |
| background-position: 50% 50%; |
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/bash | |
| ` | |
| add () { | |
| git add . | |
| } | |
| commit () { | |
| git commit -m "$1" | |
| } |
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
| """ Extend SQLAlchemy | |
| This is an experiment to put in common some logique beetween sqla model class so that | |
| most queries are done through a shared interface. | |
| Some calls are specific to flask_sqlavhemy or smorest but can be easily adapted. | |
| """ | |
| from typing import TYPE_CHECKING |
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 PostProcessingTask: | |
| def __init__(self, func: Callable[..., None], *args: Any, **kwargs: Any): | |
| self.func = func | |
| self.args = args | |
| self.kwargs = kwargs | |
| def execute(self) -> None: | |
| self.func(*self.args, **self.kwargs) |