Skip to content

Instantly share code, notes, and snippets.

Avatar
💻
Writing code

Karytonn Karytonn

💻
Writing code
View GitHub Profile
View FunctionCallOrder.ts
let msn = 'First';
// Without auto invocation
const write = (): string => {
console.log('Second');
return '...';
};
// With auto invocation
const message = write();
@Karytonn
Karytonn / tsconfig.json
Last active Jun 21, 2022
TypeScript fake declaration type
View tsconfig.json
{
"compilerOptions": {
....
},
"types": [...]
},
// Include the source of fake type declaration
"include": ["src", "type.lib-name-here.ts"],
"exclude": [...]
}
@Karytonn
Karytonn / google_sheet-to-json.md
Last active Nov 4, 2021
How to get a Google Sheet as JSON
View google_sheet-to-json.md

How to get a Google Sheet as JSON

Preparing Your Google Sheet

  1. The first row of your spreadsheet should be headers, and the rest is data under those headers (see example).
  2. Share the spreadsheet so anyone can see it (“Share” button in top right corner > “Anyone on the internet with this link can view”).

Preparing you url access

@Karytonn
Karytonn / Copyright-danamic-year.markdown
Last active Nov 2, 2021
Copyright template with dinamic year
View Copyright-danamic-year.markdown
@Karytonn
Karytonn / Angular >> Move to different page
Last active Oct 20, 2021
Angular >> Move to different page
View Angular >> Move to different page
@Component({
selector: 'app-visit-rangle',
template: `
<button
type="button"
(click)="goTopage()">
Visit Rangle
</button>
`
})
@Karytonn
Karytonn / Angular-dynamic-font-size.ts
Last active Oct 20, 2021
Angular: font-size and accessibility
View Angular-dynamic-font-size.ts
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-header-accessibility',
templateUrl: './header-accessibility.component.html',
styleUrls: ['./header-accessibility.component.scss']
})
export class HeaderAccessibilityComponent implements OnInit {
//Default and reset font size
@Karytonn
Karytonn / isScroll.markdown
Last active Oct 20, 2021
Find out which element is creating horizontal scroll?
View isScroll.markdown

Find out which element is creating horizontal scroll?

Run the following code in your browser console to find out who is at fault:

let width = document.documentElement.offsetWidth;

[].forEach.call(
  document.querySelectorAll('*'),
 function(el) {
View get-full-year-js.markdown

Get Full Year with Javascript


Using on copyright

<div class="footer">
  <p>
    Copyright &copy;
  | Created by