Skip to content

Instantly share code, notes, and snippets.

View jasonhodges's full-sized avatar

Jason Hodges jasonhodges

  • out in the country
View GitHub Profile
@jasonhodges
jasonhodges / input.scss
Created March 10, 2023 15:29
Generated by SassMeister.com.
@use "sass:selector";
@use "sass:string";
.grid {
display: grid;
grid-template-columns: repeat(2, 1fr);
grid-template-rows: repeat(5, 1fr);
grid-column-gap: 16px;
grid-row-gap: 24px;
&_item {
@jasonhodges
jasonhodges / input.scss
Last active December 12, 2022 15:55
Generated by SassMeister.com.
$bp_xs: 600px;
$bp_sm: 960px;
$bp_md: 1280px;
$bp_lg: 1920px;
$bp_xl: 3200px;
$bp_xxl: 5760px;
@mixin bp_lt-xs {
@media screen and (max-width: #{$bp_xs - 1px}) {
@content;
@jasonhodges
jasonhodges / input.scss
Created November 30, 2022 12:22
Generated by SassMeister.com.
@mixin random-bgr(){
background: rgb(random(255), random(255), random(255));
}
$num_colors: 20;
@for $i from 0 to $num-colors {
container_#{$i} {
@include random-bgr();
}
}
@jasonhodges
jasonhodges / input.scss
Created November 28, 2022 15:00
Generated by SassMeister.com.
@mixin random-bgr(){
background: rgb(random(255), random(255), random(255));
}
$num_colors: 20;
@for $i from 0 to $num-colors {
container_#{$i} {
@include random-bgr();
}
}
@jasonhodges
jasonhodges / input.scss
Created March 29, 2021 20:35
Generated by SassMeister.com.
@use "sass:map";
.container-outer {
display: flex;
padding: 32px;
align-items: center;
flex-direction: column;
background-color: lightblue;
}
@jasonhodges
jasonhodges / thirty_line
Last active May 19, 2020 19:51
30 line gist test
1
2
3
4
5
6
7
8
9
10
@jasonhodges
jasonhodges / twenty_line
Created May 19, 2020 19:50
20 line gist test
1
2
3
4
5
6
7
8
9
10
@jasonhodges
jasonhodges / ten_line
Created May 19, 2020 19:49
10 line gist test
1
2
3
4
5
6
7
8
9
10
@jasonhodges
jasonhodges / deepcopy.ts
Created April 19, 2017 13:27
demo TypeScript deepcopy function
// https://egghead.io/lessons/typescript-deep-copy-aka-clone-objects-using-typescript
function deepcopy<T>(o: T): T {
return JSON.parse(JSON.stringify(o));
}
const foo = {
x: {
y: {
z: 123
}
@jasonhodges
jasonhodges / example.component.ts
Created October 23, 2017 15:46 — forked from ckimrie/example.component.ts
Example on how to achieve RxJS observable caching and storage in Angular 2+. Ideal for storing Http requests client side for offline usage.
import { Component, OnInit, OnDestroy } from '@angular/core';
import {Http} from "@angular/http";
import { LocalCacheService } from "./local-cache.service";
@Component({
selector: 'app-example',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
})
export class ExampleComponent implements OnInit, OnDestroy {