lemanschik / awesome

A Magic Repository Started By a Magic Number enables git tree submodule branch flows.
1 stars 2 forks source link

github mappings to polyfill workaround none existing clean git implementation #4

Open lemanschik opened 1 year ago

lemanschik commented 1 year ago

Below example shows how to

// Note a shorter hash also works! like taking first 8 would be logical or 16 full is 32
// example shows lemanschik/awesome module/git git.js 
// https://raw.githubusercontent.com/lemanschik/awesome/211a7e66d254a91fa0fccc201a766e8bbc3e1064/git.js
// https://github.com/lemanschik/awesome/blob/211a7e66d254a91fa0fccc201a766e8bbc3e1064/git.js
// https://github.com/lemanschik/awesome/tree/211a7e66d254a91fa0fccc201a766e8bbc3e1064

// githubRaw('lemanschik/awesome, 'module/git', 'git.js');
const githubRaw = (specifier, gitRef, fileName) => 
  `https://raw.githubusercontent.com/${specifier}/${gitRef}/${fileName}`;

const gitSubModule = (gitModulesContent) => gitModulesContent.split('\n').reduce((modules,line,idx,gitmodules) => { 
 line.trim().startsWith('[') && modules.push(`${[gitmodules[idx], gitmodules[idx+1], gitmodules[idx+2]]
   .map(String.prototype.trim.call).join(' ')}`);
},[])

const readModule = (moduleLine) => moduleLine
  .replace('[submodule "','').replace('"]','').replace(' path = ',' ').replace(' url = ',' ');

[submodule "github.com/lemanschik/awesome"] path = github.com/lemanschik/awesome url = git@github.com:lemanschik/awesome.git [submodule "github.com/unlicense-code/awesome"] path = github.com/unlicense-code/awesome url = git@github.com:unlicense-code/awesome.git [submodule "github.com/unlicense-code/awesome-b8g"] path = github.com/unlicense-code/awesome-b8g url = git@github.com:unlicense-code/awesome-b8g.git

lemanschik commented 1 year ago

wget https://github.com/ /tarball/master -O dummy.tgz curl -L https://github.com/ /tarball/master -o dummy.tgz

wget --no-check-certificate https://github.com/ /tarball/master -O - | tar -xz curl -L -k https://github.com/ /tarball/master | tar -xz

-u token:x-oauth-basic

lemanschik commented 1 year ago

docker volume create --driver local \ --opt type=tmpfs \ --opt device=tmpfs \ --opt o=size=100m,uid=1000 \ foo Another example that uses btrfs:

docker volume create --driver local \ --opt type=btrfs \ --opt device=/dev/sda2 \ foo