This file contains 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
# login in windows store | |
######## install and reload ######## | |
winget install scoop | |
winget install vscode | |
#################################### | |
winget install Microsoft.WindowsTerminal | |
winget install cpu-z | |
winget install SlackTechnologies.Slack | |
winget install mozilla.firefox |
This file contains 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
if (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) | |
{ | |
$arguments = "& '" +$myinvocation.mycommand.definition + "'" | |
Start-Process powershell -Verb runAs -ArgumentList $arguments | |
Break | |
} | |
$status = (-Not (Get-MpPreference).DisableRealtimeMonitoring) | |
Set-MpPreference -DisableRealtimeMonitoring $status | |
$status |
This file contains 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
DECLARE @Sql NVARCHAR(500) DECLARE @Cursor CURSOR | |
SET @Cursor = CURSOR FAST_FORWARD FOR | |
SELECT DISTINCT sql = 'ALTER TABLE [' + tc2.TABLE_SCHEMA + '].[' + tc2.TABLE_NAME + '] DROP [' + rc1.CONSTRAINT_NAME + '];' | |
FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS rc1 | |
LEFT JOIN INFORMATION_SCHEMA.TABLE_CONSTRAINTS tc2 ON tc2.CONSTRAINT_NAME =rc1.CONSTRAINT_NAME | |
OPEN @Cursor FETCH NEXT FROM @Cursor INTO @Sql | |
WHILE (@@FETCH_STATUS = 0) |
This file contains 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
# /bin/python | |
import mouse | |
import time | |
(X, Y) = mouse.get_position() | |
mov = False | |
while True: | |
X = X + 1 if mov else X - 1 |
This file contains 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
#/bin/bash | |
####################################### | |
# Enables or disables laptop keyboard # | |
####################################### | |
# Keyboard name to work with | |
KB_NAME="AT Translated Set 2 keyboard" | |
# Grab keyboard ID | |
KB_ID=$(xinput list | grep "$KB_NAME" | awk '{ print $7 }' | sed -r 's/id=//g') |
This file contains 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
#/bin/bash | |
# install docker in Fedora 32 | |
# add repo | |
sudo dnf config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo | |
# use 31 version (There are no official support for 32) | |
sudo sed -i 's/$releasever/31/g' /etc/yum.repos.d/docker-ce.repo |
This file contains 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
console.log('A basic FizzBuzz in typescript') | |
const START_NUMBER = 1; | |
const LAST_NUMBER = 100; | |
const FIZZ = 'Fizz'; | |
const BUZZ = 'Buzz'; | |
function calcFizzBuzz(n: number): string | number { | |
let toPrint = ''; |
This file contains 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
#!/bin/bash | |
# Install traefik for DOCKER + LET'S ENCRYPT | |
# RUN (./start.sh [DOMAIN] [EMAIL]) or change domain and email vars | |
DOMAIN=$1 | |
EMAIL=$2 | |
echo "running config for domain: ${DOMAIN} and email: ${EMAIL}" | |
read -p "Are you sure? " -n 1 -r | |
echo |
This file contains 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
#!/bin/bash | |
pacmd list-sink-inputs |\ | |
grep media.name |\ | |
sed -n -e 's/^.*media\.name = //p' |\ | |
sed 's/"//g' |\ | |
sed "s/'//g" |\ | |
sed 's/playback stream//ig' |\ | |
sed 's/playback//ig' |\ | |
sed 's/AudioCallbackDriver//ig' |\ | |
sed 's/AudioStream//ig' |\ |
This file contains 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
using System; | |
namespace Algorithms | |
{ | |
public static class LevenshteinDistance | |
{ | |
/// <summary> | |
/// Calculate the difference between 2 strings using the Levenshtein distance algorithm | |
/// </summary> | |
/// <param name="source1">First string</param> |
NewerOlder