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
#!/usr/bin/env bash | |
# A portable script for a powerline like prompt | |
reset='\[\033[0m\]' | |
bg='\[\033[48;2;48;48;48m\]' | |
blue='\[\033[38;2;0;175;255m\]' | |
green='\[\033[38;2;95;215;0m\]' | |
grey='\[\033[38;2;88;88;88m\]' | |
greydark='\[\033[38;2;48;48;48m\]' |
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 c: | |
"""Terminal espcape sequences for colors""" | |
OK = "\033[92m" | |
WARN = "\033[93m" | |
END = "\033[0m" | |
# Examples |
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
"""Time any function""" | |
from asyncio import iscoroutinefunction | |
from collections.abc import Awaitable, Callable, Coroutine | |
from contextlib import contextmanager | |
from functools import wraps | |
from inspect import isawaitable | |
from logging import StreamHandler, getLogger | |
from logging.handlers import RotatingFileHandler | |
from sys import stdout |
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
"""Stolen from: | |
https://stackoverflow.com/questions/66615552/display-multi-line-python-console-ascii-animation | |
""" | |
import time | |
nlines = 5 | |
# scroll up to make room for output | |
print(f"\033[{nlines}S", end="") |
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
package main | |
import ( | |
"fmt" | |
"io" | |
"os" | |
) | |
func main() { | |
filePath := os.Args[1] |
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
// language=GLSL | |
const SHADER_SOURCE = /*glsl*/ ` | |
precision highp float; | |
varying vec4 v_color; | |
varying vec2 v_diffVector; | |
varying float v_radius; | |
varying vec4 v_texture; | |
varying float v_texture_index; |
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
// 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 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 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 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 |
NewerOlder