Skip to content

Instantly share code, notes, and snippets.

View amritk's full-sized avatar
🏒

Amrit Kahlon amritk

🏒
View GitHub Profile
{ openapi: '3.1.0', info: { title: 'Example', version: '0.0.1' }, paths: {} }
@amritk
amritk / Debloat
Last active January 7, 2021 01:14
Debloat S20
pm uninstall --user 0 com.samsung.android.bixby.wakeup
pm uninstall --user 0 com.samsung.android.app.spage
pm uninstall --user 0 com.samsung.android.app.routines
pm uninstall --user 0 com.samsung.android.bixby.service
pm uninstall --user 0 com.samsung.android.visionintelligence
pm uninstall --user 0 com.samsung.android.bixby.agent
pm uninstall --user 0 com.samsung.android.bixby.agent.dummy
pm uninstall --user 0 com.samsung.android.bixbyvision.framework
pm uninstall --user 0 com.samsung.android.samsungpassautofill
@amritk
amritk / RenameCamelCase.sh
Created May 23, 2019 22:58
Rename all camel cased vue files to kebab case, including subdirectories
for file in $(find . -name '*.vue') ; do
mv "$file" "$(echo $file|sed -e 's/\([A-Z]\)/-\L\1/g' -e 's/\/-/\//')"
done
@amritk
amritk / youtube.scss
Created January 14, 2019 23:53
A bit of style for the youtube iframe
.youtube-wrapper {
position: relative;
padding-bottom: 52%; /* 16:9 */
padding-top: 25px;
height: 0;
iframe {
position: absolute;
top: 0;
left: 0;
width: 100%;
@amritk
amritk / youtube.html
Last active January 14, 2019 23:46
Youtube embed
<div class="youtube-wrapper" if="youtubeUrl">
<iframe src="{{ youtubeUrl }}" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"
allowfullscreen>
</iframe>
</div>
@amritk
amritk / youtube.ts
Created January 14, 2019 23:34
A simple regex parser for youtube links
checkForYoutube(body: string) {
const matches = body.match(/\s?((?:https?:)?\/\/)?((?:www|m)\.)?((?:youtube\.com|youtu.be))(\/(?:[\w\-]+\?v=|embed\/|v\/)?)([\w\-]+)(\S+)?\s?/)
if (matches && matches.length > 4) {
this.youtubeUrl = `https://www.youtube.com/embed/${matches[5]}`
}
}
@amritk
amritk / vue.config.js
Created November 29, 2018 00:43
Automatically import components
const fs = require('fs')
// Get component names
const components = []
fs.readdir('src/components', function (err, items) {
for (var i = 0; i < items.length; i++) {
components.push(items[i].slice(0, -4))
}
});
@amritk
amritk / dragdrop.js
Last active April 19, 2017 18:33
Trying to get this dragdrop from this codrops article working on the latest version of dragabilly
/**
* dragdrop.js
* http://www.codrops.com
*
* Licensed under the MIT license.
* http://www.opensource.org/licenses/mit-license.php
*
* Copyright 2014, Codrops
* http://www.codrops.com
*