Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python3.7
import asyncio
import iterm2
async def changeTheme(connection,parts):
theme_dark = "Tango Dark"
theme_light = "Tango Light"
print(parts)
{
"telemetry.enableTelemetry": false,
"terminal.integrated.fontFamily": "TerminessTTF Nerd Font, monospace",
"editor.renderControlCharacters": true,
"files.autoSave": "onFocusChange",
"editor.fontFamily": "SpaceMono Nerd Font Mono, Menlo, monospace",
"extensions.autoUpdate": false,
"debug.console.fontFamily": "TerminessTTF Nerd Font, monospace",
"editor.codeLensFontFamily": "TerminessTTF Nerd Font, monospace",
"window.zoomLevel": 1,
@TobiG77
TobiG77 / readme.md
Created February 15, 2021 08:17
Additional steps for nerves on jetsan nano
@TobiG77
TobiG77 / rules.cue
Last active July 29, 2020 20:47
validate payload with cue vet
payload.json:
{
"resource_id": "/subscription/.../...",
"version": "2020-07-21",
"type": "Linux",
"properties": {
"custom_log_files": [
"/var/log/dmesg",
"/var/log/messages"
@TobiG77
TobiG77 / pgadmin-on-centos7 for testing
Last active December 5, 2016 01:37
pgadmin-on-centos7 for testing
#!/usr/bin/env bash
REPO_PREFIX="https://download.postgresql.org/pub/repos/yum"
REPO_SUFFIX="9.6/redhat/rhel-7-x86_64"
wget "$REPO_PREFIX/RPM-GPG-KEY-PGDG-96"
sudo rpm --import ./RPM-GPG-KEY-PGDG-96
rm -f ./RPM-GPG-KEY-PGDG-96
echo "
@TobiG77
TobiG77 / helper_methods.ex
Last active January 8, 2016 02:38
collection of persistence helper methods
defmodule FunctionHead do
def create(attrs) when is_map(attrs) do
with {:ok, doc} <- new(attrs),
{:ok, _ } <- persist(doc),
do: {:ok, doc}
end
def persist(doc), do: ExAws.Dynamo.put_item(__MODULE__.table_name, doc)
def where(filter) when is_map(filter) do
with {:ok, response } <- ExAws.Dynamo.get_item(__MODULE__.table_name, filter),
@TobiG77
TobiG77 / gist:c2fa52b879c69f8747ee
Last active December 22, 2015 01:31
functional vs objective thinking and elixir data structures are immutable
doc = %{id: "Foo"}
#wrong
defmodule FooBar do
def valid_version(doc) do
if (is_integer(doc.version)), do: doc, else: doc.version = 1
end
end
# correct
@TobiG77
TobiG77 / opensuse-rdm-build
Last active February 4, 2016 12:43
Build RedisDesktopManager on OpenSuSE (TumbleWeed) from source
sudo zypper in -t pattern devel_qt5
sudo zypper in subversion lndir
Then, as per: https://github.com/uglide/RedisDesktopManager/wiki/Build-from-source
git clone --recursive https://github.com/uglide/RedisDesktopManager.git rdm
cd rdm
mkdir -p obj-build
cd obj-build
lndir ../src