Skip to content

Instantly share code, notes, and snippets.

View alesvaupotic's full-sized avatar

Aleš Vaupotič alesvaupotic

View GitHub Profile

Keybase proof

I hereby claim:

  • I am alesvaupotic on github.
  • I am alesvaupotic (https://keybase.io/alesvaupotic) on keybase.
  • I have a public key whose fingerprint is 4E7A 4FBE E74C 1432 7279 78B3 5EB3 825F 9F55 DBE6

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am alesvaupotic on github.
  • I am alesvaupotic (https://keybase.io/alesvaupotic) on keybase.
  • I have a public key ASB2_q2uQMwaHSlaqJyKGXV09SoNkyVm0J4p99b3mC-ZXQo

To claim this, I am signing this object:

@alesvaupotic
alesvaupotic / tsconfig.json
Created April 28, 2021 08:06
tsconfig for vite aliases
{
"extends": "@tsconfig/svelte/tsconfig.json",
"compilerOptions": {
"baseUrl": ".",
"paths": {
"$components/*": ["./src/components/*"],
"$/*": ["./src/*"]
}
},
"include": ["src/**/*.d.ts", "src/**/*.js", "src/**/*.svelte"]
@alesvaupotic
alesvaupotic / gist:d87fb6381ee414327de3d55b478dfb83
Created April 1, 2021 12:23
Clear repository history - upload as fresh project
rm -rf .git
git init
git add .
git commit -m "Initial commit"
git branch -m main
git remote add origin git@github.com:USERNAME/REPO.git
git push -u --force origin main
CREATE TABLE `uporabnik` (
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`ime` VARCHAR(50) NULL DEFAULT '' COLLATE 'utf8mb4_0900_ai_ci',
`org_ulica` VARCHAR(50) NULL DEFAULT '' COLLATE 'utf8mb4_0900_ai_ci',
PRIMARY KEY (`id`) USING BTREE,
INDEX `ime` (`ime`) USING BTREE
);
INSERT INTO `uporabnik` (`ime`, `org_ulica`) VALUES ('Prvi', 'Prva ulica 1');
INSERT INTO `uporabnik` (`ime`, `org_ulica`) VALUES ('Drugi', 'Druga ulica 2');
@alesvaupotic
alesvaupotic / gist:5857edaf474756185924d73ebb4e0e91
Created December 30, 2020 14:26
Lose all commit history of a project
git init
git remote add origin git@github.com:USERNAME/REPOSITORY.git
git add *
git commit -am 'Init'
git push -f origin HEAD:main
<p>Drag the following link into your Bookmarks Bar</p>
<a href="javascript:i=prompt('Search Google for JS in last two years');if(i)location.href='https://www.google.com/search?q='+escape(i)+' -angular -vue -ember -react -jquery js javascript after:'+((new Date()).getFullYear()-2)+'-01-01';">JS</a>
@alesvaupotic
alesvaupotic / LaravelActionBladeIfs.php
Last active June 30, 2018 09:26
Laravel Blade helpers for Actions in @included files
Blade::if('edit', function () {
return ( request()->route()->getActionMethod()==='edit');
});
Blade::if('create', function () {
return ( request()->route()->getActionMethod()==='create');
});
Blade::if('index', function () {
return ( request()->route()->getActionMethod()==='index');
Open Command Prompt as Administrator
assoc .="No Extension"
ftype "No Extension"="C:\Program Files (x86)\Notepad++\notepad++.exe" "%1"
assoc "No Extension"\DefaultIcon=%SystemRoot%\System32\imageres.dll,-102
@alesvaupotic
alesvaupotic / LXD setup
Created November 27, 2017 18:37
After setup, set ZFS compression for your poll and updates for LXD
#as sudo
zfs set compression=lz4 containers
zfs get compressratio containers
lxc config set images.auto_update_cached true
lxc config set images.remote_cache_expiry 1
lxc config set images.auto_update_interval 0