Skip to content

Instantly share code, notes, and snippets.

@jtpio
jtpio / README.md
Last active February 26, 2024 15:08
Jupyter Notebook 7 with RTC on Binder

Jupyter Notebook v7 with Real-Time Collaboration on Binder

Jupyter Notebook Logo

@jdoss
jdoss / devel_services_pod.sh
Created February 22, 2022 23:17
Quickly launch Elasticsearch, Redis, and PostgreSQL inside a Podman pod.
#!/bin/bash
set -e
ELASTICSEARCH_VERSION=7.5.2
ELASTICSEARCH_PORT=9200
REDIS_VERSION=6.0.1
REDIS_PORT=6379
@BrianGilbert
BrianGilbert / userChrome.css
Last active July 7, 2025 00:55
Firefox userChrome to autohide Sideberry panel and hide titlebar tabs, and autohide Page Actions.
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/*
* This style will hide the tab bar. For MacOS Big Sur
*
* Contributor(s): Isaac-Newt, Ivan0xFF, millerdev, AMomchilov
*/
@bmcbm
bmcbm / setup-nvdia-suspend.sh
Last active July 21, 2025 12:26
NVIDIA Suspend fix
# Use systemd for managing NVIDIA driver suspend in drivers ====>>> PRIOR to version 470 <<<=====
# https://download.nvidia.com/XFree86/Linux-x86_64/450.66/README/powermanagement.html
# https://forums.developer.nvidia.com/t/unable-to-set-nvidia-kernel-module-parameters/161306
# Please note: In Fedora Linux you may need to just install the xorg-x11-drv-nvidia-power pakage
# as sugested by @goombah88 in the comments below.
TMP_PATH=/var/tmp
TMPL_PATH=/usr/share/doc/nvidia-driver-460/
echo "options nvidia NVreg_PreserveVideoMemoryAllocations=1 NVreg_TemporaryFilePath=${TMP_PATH}" | sudo tee /etc/modprobe.d/nvidia-power-management.conf
@fabi1cazenave
fabi1cazenave / lafayette_install.py
Last active May 22, 2018 16:32
Qwerty-Lafayette installer for XKB
#!/usr/bin/env python3
import os
import shutil # backups...
import textwrap # dedent hard-coded symbol strings
from lxml import etree
from lxml.builder import E
XKB = '/usr/share/X11/xkb/'
NAME = 'lafayette'
LAYOUTS = {'fr': [{
@linar-jether
linar-jether / simple_python_datasource.py
Last active September 10, 2024 19:46
Grafana python datasource - using pandas for timeseries and table data. inspired by and compatible with the simple json datasource ---- Up-to-date version maintained @ https://github.com/panodata/grafana-pandas-datasource
from flask import Flask, request, jsonify, json, abort
from flask_cors import CORS, cross_origin
import pandas as pd
app = Flask(__name__)
cors = CORS(app)
app.config['CORS_HEADERS'] = 'Content-Type'
@ssugar
ssugar / gist:284c7ed6a2cb764b3285
Last active August 29, 2015 14:14
Setup Vagrant Dev Environment on Windows 10

#Install Vagrant Bleeding Edge on Win 10#

###Install Chocolatey###

From elevated command prompt:

@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin  

###Install Github for Windows###

@hyuki0000
hyuki0000 / verbatim.rb
Created February 22, 2014 07:44
An Octopress plugin that renders the given content 'as is'.
# Input:
# {% verbatim tag:p %}
# $$a_1, a_2, a_3, \ldots$$
# {% endverbatim %}
#
# Output:
# <p>$$a_1, a_2, a_3, \ldots$$</p>
#
# Author: Hiroshi Yuki.
# Description: The content between {% verbatim %} and {% endverbatim %} would be rendered 'as is'.
@reorx
reorx / hash_ring.py
Last active August 18, 2022 14:59
Consistent hash implementation in Python.
# -*- coding: utf-8 -*-
"""
hash_ring
~~~~~~~~~~~~~~
Implements consistent hashing that can be used when
the number of server nodes can increase or decrease (like in memcached).
Consistent hashing is a scheme that provides a hash table functionality
in a way that the adding or removing of one slot
does not significantly change the mapping of keys to slots.
@beng
beng / autolog.py
Last active April 3, 2023 16:28 — forked from brendano/autolog.py
modified from the original to remove the use of global variables, implement a logging class instead of relying on sys.stdout, remove the function log decorator, remove the module log decorator, allow color changing on any log call, allow indentation level changing on any log call, and PEP-8 formatting.
# Written by Brendan O'Connor, [email protected], www.anyall.org
# * Originally written Aug. 2005
# * Posted to gist.github.com/16173 on Oct. 2008
# Copyright (c) 2003-2006 Open Source Applications Foundation
#
# 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
#