Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

conan-io/conan#6064 (comment)

    def test_transitive_editables_build(self):
        c = TestClient()
        libb = textwrap.dedent("""\
            from conan import ConanFile
            class LibB(ConanFile):
                name = "libb"
                version = "0.1"

Bundle npm package for browser

  1. Include the packages you want to bundle for browser
    1. npm install --save pretty
  2. Edit index.js to export the functions you want to use
@evandrocoan
evandrocoan / README.md
Last active February 1, 2023 13:37
Change vmware ip address remotely with ssh with auto recover in case things go wrong
  1. Run df -h to see if you have the volume /vmfs/volumes/datastore1 or datastore1
  2. Create the file /vmfs/volumes/datastore1/backup.sh to test it calling /vmfs/volumes/datastore1/backup.sh to know this script is compatible with your sh version
  3. Before testing, check if your /etc/rc.local shell bang is #! /bin/sh, and update it here if not
  4. Check if your WMware is running on UTC or in your local time zone with date command
  5. Create the backup file with cp -v /etc/vmware/esx.conf /vmfs/volumes/datastore1/esx.conf
    • Put files backup files on /vmfs/volumes/xxx because else where vmware will delete them after reboot
    • Run chmod +x /vmfs/volumes/datastore1/backup.sh
    • Edit /etc/rc.local.d/local.sh and add the line /vmfs/volumes/datastore1/backup.sh
    • Edit /vmfs/volumes/datastore1 to your correct data volume
@evandrocoan
evandrocoan / convert_yaml_json.py
Created January 10, 2023 00:53
Convert Anki decks from JSON to YAML and vice versa.
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import sys
import timeit
import datetime
import argparse
import tempfile
import pathlib
@evandrocoan
evandrocoan / .gitignore
Last active March 11, 2024 15:04
Simple C++ program example to run tests together with your code using doctest.
/build
@evandrocoan
evandrocoan / main.py
Last active August 30, 2022 11:20
Simple python program example to run tests together with your code using pytest.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import sys
import timeit
import datetime
import argparse
import pathlib
from pathlib import Path
@evandrocoan
evandrocoan / JSONLexer.py
Created April 6, 2022 22:47 — forked from erezsh/JSONLexer.py
Parsers used for Lark benchmarks
# Generated from JSON.g4 by ANTLR 4.7.1
# encoding: utf-8
from __future__ import print_function
from antlr4 import *
from io import StringIO
import sys
def serializedATN():
with StringIO() as buf:
@evandrocoan
evandrocoan / git_subbree.md
Last active January 18, 2022 12:22
Using git subtree to export a directory (with its history) from one git repository to another

Using git subtree to export a directory (with its history) from one git repository to another:

  1. git subtree add --prefix=local_directory https://github.com/account_name/other_project_to_commits master
  2. git subtree pull --prefix=local_directory https://github.com/account_name/other_project_to_commits develop
  3. git subtree push --prefix=local_directory https://github.com/account_name/other_project_to_commits develop

If you prefer to avoid repeating the repository URL, then you can add it as a remote:

  1. git remote add -f -t master --no-tags remote_name https://github.com/account_name/other_project_to_commits.git

Examples of remote name and local .git directory:

  1. git subtree add --squash --prefix=local_directory file:///D:/other_project_to_commits/.git master
@evandrocoan
evandrocoan / generate_certificate.sh
Created January 5, 2022 13:05
Generated an ssl private/public SSL certificate
#!/bin/bash
set -x
set -eu -o pipefail
function printerror
{
set +x
printf '\n'
printf 'Usage\n'
printf ' %s "key name" "key password" "servidor ip" "server name (i.e., $HOSTNAME)"\n' "$0"
@evandrocoan
evandrocoan / copy_and_move.md
Last active April 24, 2022 23:33
Copy and move constructor example, rule of 5