Skip to content

Instantly share code, notes, and snippets.

@SvS30
SvS30 / main.php
Created February 28, 2023 22:47
FizzBuss Solution
<?php
function fizzBuzz($multiploUno, $multiploDos) {
for ($i = 0; $i < 30; $i++) {
if ($i % $multiploUno == 0 && $i % $multiploDos == 0) echo $i.": "."FizzBuzz\n";
else if ($i % $multiploUno == 0) echo $i.": "."Fizz\n";
else if ($i % $multiploDos == 0) echo $i.": "."Buzz\n";
else echo $i."\n";
}
}
@SvS30
SvS30 / sublime.settings.json
Last active November 3, 2022 15:10
My Settings in Programs
{
"color_scheme": "Monokai.sublime-color-scheme",
"theme": "Default Dark.sublime-theme",
"ignored_packages":
[
"Vintage",
],
"font_face": "JetBrains Mono Semibold",
"font_size": 11,
}
@SvS30
SvS30 / upstream-branch.sh
Created December 23, 2021 21:08
Steps for Upstream branch add
# url is a variable, the value must be the forked repository
git remote add upstream $url
# check for any changes onto upstream
git fetch upstream
# pull changes from upstream, branch is a variable.
git rebase upstream/$branch
# push the changes from upstream to origin master
@SvS30
SvS30 / mysql-docker.sh
Last active December 4, 2021 17:26
commands to backup or restore a mysql instance in a docker container
# I use the '$' symbol to indicate that they are variables, change those values.
# Backup
docker exec $name-container mysqldump -u $user --password=$pwd $database > $file-name.sql
# Restore
cat $file-name.sql | docker exec -i $name-container mysql -u $user --password=$pwd $database
# if you don't want to type your password by terminal, or are concerned about mysql warnings.
@SvS30
SvS30 / ssh_config
Last active December 7, 2021 00:14
settings for GitHub and GitLab SSH keys.
Host github.com
User your-username
Hostname github.com
PreferredAuthentications publickey
IdentityFile /path/where/the/private-key/is/saved
Host gitlab.com
User your-username
Hostname gitlab.com
PreferredAuthentications publickey