Skip to content

Instantly share code, notes, and snippets.

View amritk's full-sized avatar
🏒

Amrit Kahlon amritk

🏒
View GitHub Profile
@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
*
@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 / 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 / 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.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 / 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 / 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
{ openapi: '3.1.0', info: { title: 'Example', version: '0.0.1' }, paths: {} }
@amritk
amritk / index.js
Created October 23, 2024 19:27
Testing api client
This file has been truncated, but you can view the full file.
!function(){"use strict";try{if("undefined"!=typeof document){var a=document.createElement("style");a.appendChild(document.createTextNode('.scalar-icon[data-v-a4126bd9],.scalar-icon[data-v-a4126bd9] *{stroke-width:var(--3c7f90fa)}.scalar-modal-layout[data-v-e37b0bd8]{animation:fadein-layout-e37b0bd8 ease-in-out .3s forwards}.scalar-modal[data-v-e37b0bd8]{animation:fadein-modal-e37b0bd8 ease-in-out .3s forwards;animation-delay:.1s;position:fixed;left:0;top:0;right:0;box-shadow:var(--scalar-shadow-2);transform:translate3d(0,10px,0)}.dark-mode .scalar-modal[data-v-e37b0bd8]{background-color:color-mix(in srgb,var(--scalar-background-1),black)}.scalar-modal.scalar-modal-search[data-v-e37b0bd8]{max-width:540px;max-height:440px;background-color:transparent}.modal-content-search .modal-body[data-v-e37b0bd8]{padding:0;overflow:hidden;display:flex;flex-direction:column;max-height:440px}@media (max-width: 1280px){.scalar-modal[data-v-e37b0bd8]{max-height:calc(100% - 56px);top:28px}}@keyframes fadein-layout-e37b0bd8{0%{o
{
"openapi": "3.1.0",
"info": {
"title": "My API",
"summary": "My API",
"description": "API for Meself",
"version": "0.1.0"
},
"paths": {
"/users/me": {