Skip to content

Instantly share code, notes, and snippets.

View prontiol's full-sized avatar
🤦‍♂️
undefined is not a function

Denys Mikhalenko prontiol

🤦‍♂️
undefined is not a function
View GitHub Profile
@prontiol
prontiol / jss.ts
Created March 7, 2023 18:49
jss.ts
interface IStyle {
[key: string]: string | IStyle,
}
interface IStyleSet {
[key: string]: IStyle,
}
type TClasses<T extends IStyleSet> = {
[key in keyof T]: string
@prontiol
prontiol / embedded-file-viewer.md
Created April 26, 2022 13:35 — forked from tzmartin/embedded-file-viewer.md
Embedded File Viewer: Google Drive, OneDrive

Office Web Apps Viewer

('.ppt' '.pptx' '.doc', '.docx', '.xls', '.xlsx')

http://view.officeapps.live.com/op/view.aspx?src=[OFFICE_FILE_URL]

<iframe src='https://view.officeapps.live.com/op/embed.aspx?src=[OFFICE_FILE_URL]' width='px' height='px' frameborder='0'>
</iframe>

OneDrive Embed Links

@prontiol
prontiol / gpg_setup.sh
Created January 5, 2020 07:10
GPG custom sockets
printf '%%Assuan%%\nsocket=/tmp/S.gpg-agent\n' > ~/.gnupg/S.gpg-agent
printf '%%Assuan%%\nsocket=/tmp/S.gpg-agent.browser\n' > ~/.gnupg/S.gpg-agent.browser
printf '%%Assuan%%\nsocket=/tmp/S.gpg-agent.extra\n' > ~/.gnupg/S.gpg-agent.extra
printf '%%Assuan%%\nsocket=/tmp/S.gpg-agent.ssh\n' > ~/.gnupg/S.gpg-agent.ssh
@prontiol
prontiol / brew_remove_deps.sh
Created December 31, 2019 01:30
Remove brew package deps
brew deps [FORMULA] | xargs brew remove --ignore-dependencies && brew missing | xargs brew install
@prontiol
prontiol / hostname.sh
Created November 29, 2019 00:43
macOS hostname
sudo scutil --set HostName ...
sudo scutil --set LocalHostName ...
sudo scutil --set ComputerName ...
@prontiol
prontiol / no_desktop.sh
Created September 22, 2019 22:27
Disable desktop icons on macOS
defaults write http://com.apple.finder CreateDesktop false && killall Finder
function swap(array, index1, index2){
[array[index1], array[index2]] = [array[index2], array[index1]];
}
@prontiol
prontiol / cartesian_array.js
Created May 15, 2019 08:20
Cartesian Product Array
const product = (...sets) =>
sets.reduce((acc, set) =>
[].concat(...acc.map(x => set.map(y => [ ...x, y ]))),
[[]]);
@prontiol
prontiol / cartesian_obj.js
Created May 15, 2019 08:18
Cartesian Product Object
const product = obj =>
Object.entries(obj).reduce((acc, [key, values]) =>
acc.reduce((acc, item) => [
...acc,
...values.map(value => ({ ...item, [key]: value }))
], []),
[{}]);
@prontiol
prontiol / getAbsoluteUrl.js
Created April 24, 2019 19:11
getAbsoluteUrl
var getAbsoluteUrl = (function() {
var a;
return function(url) {
if(!a) a = document.createElement('a');
a.href = url;
return a.href;
};
})();