Skip to content

Instantly share code, notes, and snippets.

css
:root {
--app-color-black: #111111;
--app-color-primary: #ffffff;
--app-color-secondary: #00ff1a;
}
@media (prefers-color-scheme: dark) {
:root {
--app-color-black: #ffffff;
--app-color-primary: #111111;
<script context="module" lang="ts">
import type {SvelteComponent} from 'svelte'
export const getItemId = (index: number, carouselName = 'carousel') =>
`${carouselName}-item-${index}`
export type Item = {
props: Record<string, any>
component: typeof SvelteComponent
}
</script>
@whisher
whisher / linkedArticle.ts
Created May 4, 2022 17:26
A svelte action for a clickable acrd
import { goto } from '$app/navigation';
/* eslint-disable */
export function linkedArticle(
node: HTMLElement,
parameters: { url: string } | undefined
): {
destroy: () => void;
export interface DataState {
error: string | null;
loaded: boolean;
data: GetIssuesQuery | undefined;
}
const initialState: DataState = {
error: null,
loaded: false,
data: undefined
};
import { Component, OnInit } from '@angular/core';
import { GoogleLoginProvider, SocialAuthService, SocialUser } from 'angularx-social-login';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
})
export class AppComponent implements OnInit {
title = 'calendar-app';
import { environment } from '../../../environments/environment';
const apiEndpoint = environment.apiEndpoint;
export interface PathsAuthDto {
current: string;
login: string;
signIn: string;
}
export interface PathsDto {
import React, { useState, useEffect } from "react";
import { Keyboard, View, Dimensions, Platform, StyleSheet } from "react-native";
const styles = StyleSheet.create({
container: {
left: 0,
right: 0,
bottom: 0,
},
});
Volta In Action
Let's take Volta for a spin. First, create a brand new React application with Create React App.
The full code for this lesson is contained in a GitHub repo here.
Run the following command from a terminal.
@Injectable()
export class CmsService {
private http: HttpClient;
constructor(httpBackend: HttpBackend) {
this.http = new HttpClient(httpBackend);
}
getPages(): Observable<CmsArray> {
return this.http.get<CmsArray>(
`url/pages`
@Input() error!: Required<ErrorDto> | null;
@Input() loading!: boolean;
@Input() data!: UserDto;
@Output() submitted = new EventEmitter<UserDto>();
frm!: FormGroup;
ngOnInit(){
this.createForm();
if (this.data.userId) {