Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
S
sidekick
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Privat - Marco Schmiedel
sidekick
Commits
345f746c
Commit
345f746c
authored
Dec 20, 2021
by
Marco Schmiedel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
another late night backup for bash colors
parent
6e89aa83
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
160 additions
and
12 deletions
+160
-12
BashColorDemoCommand.php
src/Commands/BashColorDemoCommand/BashColorDemoCommand.php
+24
-0
CodebeautifierCommand.php
src/Commands/CodebeautifierCommand/CodebeautifierCommand.php
+27
-0
TerminalManager.php
src/Managers/TerminalManager/TerminalManager.php
+85
-0
CommandServiceProvider.php
src/Providers/CommandServiceProvider.php
+0
-9
CommandServiceProvider.php
...oviders/CommandServiceProvider/CommandServiceProvider.php
+14
-0
CoreServiceProvider.php
src/Providers/CoreServiceProvider.php
+10
-3
No files found.
src/Commands/BashColorDemoCommand/BashColorDemoCommand.php
0 → 100644
View file @
345f746c
<?php
namespace
Ceetrox\Commands\BashColorDemoCommand
;
use
Illuminate\Console\Command
;
use
Ceetrox\Managers\TerminalManager\TerminalManager
;
// This provider implements all artisan commands of sidekick and is triggered by the core provider.
class
BashColorDemoCommand
extends
Command
{
public
function
__construct
()
{
$this
->
signature
=
'sidekick:BashColorDemoCommand'
;
$this
->
description
=
TerminalManager
::
brightBlue
(
"This command returns all available colors of the terminal manager."
);
parent
::
__construct
();
}
public
function
handle
()
{
$this
->
info
(
TerminalManager
::
demo
()
);
}
}
src/Commands/CodebeautifierCommand/CodebeautifierCommand.php
0 → 100644
View file @
345f746c
<?php
namespace
Ceetrox\Commands\CodebeautifierCommand
;
use
Illuminate\Console\Command
;
use
Ceetrox\Managers\TerminalManager\TerminalManager
;
// This provider implements all artisan commands of sidekick and is triggered by the core provider.
class
CodebeautifierCommand
extends
Command
{
public
function
__construct
()
{
$this
->
signature
=
'sidekick:CodebeautifierCommand'
;
$this
->
description
=
TerminalManager
::
brightBlue
(
"This command is a php code beautifier."
);
parent
::
__construct
();
}
public
function
handle
()
{
$this
->
info
(
TerminalManager
::
demo
()
);
}
}
src/Managers/TerminalManager/TerminalManager.php
0 → 100644
View file @
345f746c
<?php
/* ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ *\
|◦ Namespaces
\* ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ */
namespace
Ceetrox\Managers\TerminalManager
;
/* ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ */
class
TerminalManager
{
static
function
brightBlue
(
$text
)
{
return
TerminalManager
::
brightColor
(
$text
,
33
);
}
static
function
darkColor
(
$text
,
$color
)
{
return
"\e[0m"
.
"\e[48;5;234m"
.
"\e[38;5;"
.
$color
.
"m"
.
$text
.
"\e[0m"
;
}
static
function
brightColor
(
$text
,
$color
)
{
return
"\e[0m"
.
"\e[38;5;16m"
.
"\e[48;5;"
.
$color
.
"m"
.
$text
.
"\e[0m"
;
}
static
function
demo
()
{
$text
=
"
\n
"
;
$i1
=
16
;
while
(
$i1
<
52
)
{
$i2
=
$i1
+
36
;
$i3
=
$i2
+
36
;
$i4
=
$i3
+
36
;
$i5
=
$i4
+
36
;
$i6
=
$i5
+
36
;
$i7
=
$i6
+
36
;
if
(
$i7
>
250
)
{
$i7
=
$i7
-
251
;
}
$text
.=
TerminalManager
::
darkColor
(
" D"
.
str_pad
(
$i1
,
3
,
"0"
,
STR_PAD_LEFT
)
.
" "
,
$i1
);
$text
.=
TerminalManager
::
darkColor
(
" D"
.
str_pad
(
$i2
,
3
,
"0"
,
STR_PAD_LEFT
)
.
" "
,
$i2
);
$text
.=
TerminalManager
::
darkColor
(
" D"
.
str_pad
(
$i3
,
3
,
"0"
,
STR_PAD_LEFT
)
.
" "
,
$i3
);
$text
.=
TerminalManager
::
darkColor
(
" D"
.
str_pad
(
$i4
,
3
,
"0"
,
STR_PAD_LEFT
)
.
" "
,
$i4
);
$text
.=
TerminalManager
::
darkColor
(
" D"
.
str_pad
(
$i5
,
3
,
"0"
,
STR_PAD_LEFT
)
.
" "
,
$i5
);
$text
.=
TerminalManager
::
darkColor
(
" D"
.
str_pad
(
$i6
,
3
,
"0"
,
STR_PAD_LEFT
)
.
" "
,
$i6
);
$text
.=
TerminalManager
::
darkColor
(
" D"
.
str_pad
(
$i7
,
3
,
"0"
,
STR_PAD_LEFT
)
.
" "
,
$i7
);
$text
.=
TerminalManager
::
brightColor
(
" B"
.
str_pad
(
$i1
,
3
,
"0"
,
STR_PAD_LEFT
)
.
" "
,
$i1
);
$text
.=
TerminalManager
::
brightColor
(
" B"
.
str_pad
(
$i2
,
3
,
"0"
,
STR_PAD_LEFT
)
.
" "
,
$i2
);
$text
.=
TerminalManager
::
brightColor
(
" B"
.
str_pad
(
$i3
,
3
,
"0"
,
STR_PAD_LEFT
)
.
" "
,
$i3
);
$text
.=
TerminalManager
::
brightColor
(
" B"
.
str_pad
(
$i4
,
3
,
"0"
,
STR_PAD_LEFT
)
.
" "
,
$i4
);
$text
.=
TerminalManager
::
brightColor
(
" B"
.
str_pad
(
$i5
,
3
,
"0"
,
STR_PAD_LEFT
)
.
" "
,
$i5
);
$text
.=
TerminalManager
::
brightColor
(
" B"
.
str_pad
(
$i6
,
3
,
"0"
,
STR_PAD_LEFT
)
.
" "
,
$i6
);
$text
.=
TerminalManager
::
brightColor
(
" B"
.
str_pad
(
$i7
,
3
,
"0"
,
STR_PAD_LEFT
)
.
" "
,
$i7
);
$text
.=
"
\n
"
;
$i1
+=
1
;
}
return
$text
;
}
}
src/Providers/CommandServiceProvider.php
deleted
100644 → 0
View file @
6e89aa83
<?php
namespace
Ceetrox\Providers
;
class
CommandServiceProvider
{
}
src/Providers/CommandServiceProvider/CommandServiceProvider.php
0 → 100644
View file @
345f746c
<?php
namespace
Ceetrox\Providers\CommandServiceProvider
;
use
Illuminate\Support\ServiceProvider
;
// This provider implements all artisan commands of sidekick and is triggered by the core provider.
class
CommandServiceProvider
extends
ServiceProvider
{
public
function
register
()
{
$this
->
commands
(
'Ceetrox\Commands\CodebeautifierCommand\CodebeautifierCommand'
);
$this
->
commands
(
'Ceetrox\Commands\BashColorDemoCommand\BashColorDemoCommand'
);
}
}
src/Providers/CoreServiceProvider.php
View file @
345f746c
<?php
<?php
namespace
Ceetrox\Providers
;
namespace
Ceetrox\Providers
;
use
Illuminate\Support\ServiceProvider
;
use
Ceetrox\Providers\CommandServiceProvider\CommandServiceProvider
;
class
CoreServiceProvider
{
// This provider implements the core system of sidekick.
class
CoreServiceProvider
extends
ServiceProvider
{
public
function
register
()
{
// Register the artisan command service provider.
app
()
->
register
(
new
CommandServiceProvider
(
app
()
)
);
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment