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
# clap + Figment | |
for command line switches like: program --help, program --input "asdf" i want to use `clap` and for config file | |
parsing like `pankat.toml` i want to use Figment. | |
after studying https://steezeburger.com/2023/03/rust-hierarchical-configuration/ i came up with my solution, | |
which is quite similar, except it splits the clap arguments into default values and explicit values for the later merge. | |
now i can either use: |
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
# main.rs | |
#[macro_use] | |
extern crate html5ever; | |
extern crate markup5ever_rcdom as rcdom; | |
use html5ever::parse_document; | |
use html5ever::tendril::TendrilSink; | |
use rcdom::{Handle, NodeData, RcDom}; | |
use std::io::Cursor; |
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
[remote "origin"] | |
url = https://qknight:[email protected]/nixcloud/pankat-replit | |
fetch = +refs/heads/*:refs/remotes/origin/* | |
[branch "main"] | |
remote = origin | |
merge = refs/heads/main | |
afterwards do: |
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
// This features two textareas in a horizontal layout which adapt their height to the content and | |
// sync the height among both textareas. It supports downsizing as well. | |
// It is also quite a hack but it works! | |
#[component] | |
pub fn DescriptionEdit( | |
description_source: RwSignal<String>, | |
description_destination: RwSignal<String>, | |
merge_ui_element_states: RwSignal<HashMap<&'static str, i32>>, | |
unique_name: &'static str, |
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
package main | |
import ( | |
"fmt" | |
"gorm.io/driver/postgres" | |
"gorm.io/gorm" | |
"gorm.io/gorm/logger" | |
"log" | |
) |
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
we want to use the environment you define below to pass in the local.py which contains the configuration for the database for django. | |
however, you code uses the preStart which we can't support in nixcloud-webservices in a similar way so we play with the environment variable called PYTHONPATH like shown below. | |
problem: our local.py configuration is never used, so we kindly ask you what we do wrong. | |
we also tried `manage.py`'s command line arguments as --pythonpath and --settings but we can't get them to work as python errors out because of not finding a module. | |
# our code |
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
# wanting to package https://github.com/taigaio/taiga-back | |
pip2nix3 generate -r requirements.txt | |
/nix/store/363rkdz279i1ppiqha1f8vgh6a5p6xz9-python3.5-pip-9.0.1/lib/python3.5/site-packages/pip/cmdoptions.py:39: RemovedInPip10Warning: --no-use-wheel is deprecated and will be removed in the future. Please use --no-binary :all: instead. | |
fmt_ctl_no_use_wheel(control) | |
Collecting git+git://github.com/Python-Markdown/markdown.git (from -r requirements.txt (line 4)) | |
Cloning git://github.com/Python-Markdown/markdown.git to /tmp/pip-gd8bpttj-build | |
Complete output from command python setup.py egg_info: | |
Traceback (most recent call last): |
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
# Gemfile.lock update of oj | |
git diff | |
diff --git a/Gemfile.lock b/Gemfile.lock | |
index 1b69af2..22b8fad 100644 | |
--- a/Gemfile.lock | |
+++ b/Gemfile.lock | |
@@ -7,7 +7,7 @@ PATH | |
em-http-request (~> 0.3.0) | |
em-websocket (~> 0.5.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
on ubuntu 18.04 LTS i do this: | |
gem install slanger | |
Building native extensions. This could take a while... | |
ERROR: Error installing slanger: | |
ERROR: Failed to build gem native extension. | |
current directory: /var/lib/gems/2.5.0/gems/oj-2.12.14/ext/oj | |
/usr/bin/ruby2.5 -r ./siteconf20180609-3115-hpt4bd.rb extconf.rb |
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
# This Makefile is for the NetAddr::IP::Util extension to perl. | |
# | |
# It was generated automatically by MakeMaker version | |
# 7.1002 (Revision: 71002) from the contents of | |
# Makefile.PL. Don't edit this file, edit Makefile.PL instead. | |
# | |
# ANY CHANGES MADE HERE WILL BE LOST! | |
# | |
# MakeMaker ARGV: (q[PREFIX=/nix/store/gzbb4v0qg5vdfd3gpcjkyf4prkfzrhna-perl-NetAddr-IP-4.079], q[INSTALLDIRS=site], q[PERL=/nix/store/ggb7k5x9855j10dz99467djx4rplg32b-perl-5.24.3/bin/perl], q[FULLPERL=/nix/store/ggb7k5x9855j10dz99467djx4rplg32b-perl-5.24.3/bin/perl]) | |
# |
NewerOlder