Skip to content

Instantly share code, notes, and snippets.

View x1unix's full-sized avatar
:shipit:
Work in progress

Denys Sedchenko x1unix

:shipit:
Work in progress
View GitHub Profile
@ilgooz
ilgooz / query.js
Created February 22, 2024 12:29
query
test3.blocks.aggregate([
{
$search: {
index: "block-files-idx",
phrase: {
query: "// method proxies as public functions",
path: "block_body.block_data.txs.msg.package.files.body"
}
@Saluev
Saluev / emoji.py
Created December 10, 2023 17:17
Emoji regular expression for Python
"""
Regular expressions for matching emoji sequences.
For parsing single emoji, use either
re.match(EMOJI_SEQUENCE, string)
# or
EMOJI_REGEXP.match(string)
To match multiple emojis or custom patterns, insert `EMOJI_SEQUENCE` into pattern:
@CaptainGPU
CaptainGPU / IDI.glsl
Created November 29, 2023 11:07
IDI.glsl
#ifdef GL_ES
precision highp float;
#endif
uniform sampler2D u_texture_0;
uniform vec2 u_resolution;
uniform float u_time;
const float PI = 3.14159265358979323846264;
@stefanDeveloper
stefanDeveloper / shell.nix
Created March 21, 2023 09:27
Jupyter Notebook Nix Shell
with import <nixpkgs> { };
pkgs.mkShell rec {
venvDir = "./.venv";
buildInputs = [
# Defines a python + set of packages.
(python3.withPackages (ps: with python3Packages; [
jupyter
ipython
ipykernel
@raszia
raszia / pygo.go
Last active November 20, 2023 08:31
Python script inside Golang
package main
/*
#cgo CFLAGS: -I/usr/include/python3.8
#cgo LDFLAGS: -lpython3.8
#include <Python.h>
*/
import "C"
import (
@abraithwaite
abraithwaite / chill-zoom.sh
Last active March 18, 2024 17:03
Zoom in Systemd Cgroups on Linux. Change the max allocations to fit your workstation.
#!/usr/bin/bash -xe
cat <<EOF > "${HOME}/.config/systemd/user/zoom.slice"
[Slice]
AllowedCPUs=0-4
MemoryHigh=6G
EOF
cat /usr/share/applications/Zoom.desktop | sed -E 's#^(Exec=).*$#Exec=/usr/bin/systemd-run --user --slice=zoom.slice /opt/zoom/ZoomLauncher#' > "${HOME}/.local/share/applications/Zoom.desktop"
@import Darwin;
@import Foundation;
@interface IMGIFUtils
+ (bool)copyGifFromPath:(NSString*)arg1 toDestinationPath:(NSString*)arg2 error:(NSError**)arg3;
@end
int main() {
dlopen(
"/System/Library/PrivateFrameworks/IMSharedUtilities.framework/Versions/A/IMSharedUtilities",
@rupeshtiwari
rupeshtiwari / main.yaml
Created March 30, 2021 15:01
cache node_modules in github workflow
name: Caching npm packages
on: push
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2