Skip to content

Instantly share code, notes, and snippets.

View Shaun2D2's full-sized avatar
🤨

Shaun Shaun2D2

🤨
View GitHub Profile
@keyframes resize {
0% { transform: scale(1); }
25% { transform: scale(2.5); }
50% { transform: scale(1.5); }
75% { transform: scale(2.5); }
100% { transform: scale(1); }
}
body {
background-image: linear-gradient(90deg, hotpink, navy);
@Shaun2D2
Shaun2D2 / index.css
Created November 19, 2021 04:08
Box model exercises
body {
margin: 0;
padding: 0;
font-size: 1.5rem;
font-family: roboto;
}
.one {
@Shaun2D2
Shaun2D2 / index.html
Created November 18, 2021 04:39
FAB example
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" />
</head>
<body>
<label for="menu">
@Shaun2D2
Shaun2D2 / text-gradient.html
Created November 15, 2021 04:05
Fancy Text Gradient
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style>
h1 {
font-size: 72px;
background-image: linear-gradient(90deg, hotpink, blue);
@Shaun2D2
Shaun2D2 / hexToRgb.js
Created November 12, 2021 22:42
Hex to RGB example
const hex = "cb6ce6";
const hexToDecimal = (val) =>
val.split("").reverse().reduce((acc, val, index) => {
const convertedVal = parseInt(val, 16);
if (isNaN(convertedVal)) {
throw Error("invalid input passed to the conversion function");
}
import { restful } from 'redux-rocket/plugins;
import config from './baseConfig';
const module = config({
resource: 'user',
type: 'singleton',
plugins: {
include: [
restful({
@Shaun2D2
Shaun2D2 / redux-rocket-plugin-example.js
Last active January 7, 2020 17:00
structure for plugin system
// hook when the plugin initilizes
const init = () => {
// do some logic to boot up the plugin.
return execute;
}
// hook for execution
const execute = () => {
// do some logic stuff.
@Shaun2D2
Shaun2D2 / filter-object-keys.js
Created January 26, 2019 06:10
filter object keys and recombine to object
const things = { name: 'john', age: 7, crap: true };
const stuff = ['name', 'age'];
const result = Object.entries(things).filter(([index, value]) => stuff.includes(index));
const composed = result.reduce((acc, entry) => ({ [entry[0]]: entry[1], ...acc }), {})
console.log(composed);
@Shaun2D2
Shaun2D2 / TimeDiff.js
Created October 7, 2013 23:19
Time difference for javascript
var DateDiff = {
inDays: function(d1, d2) {
var t2 = d2.getTime();
var t1 = d1.getTime();
return parseInt((t2-t1)/(24*3600*1000));
},
inWeeks: function(d1, d2) {
@Shaun2D2
Shaun2D2 / new_gist_file
Created September 17, 2013 18:33
Floating orbs HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="initial-scale=1.0, user-scalable=yes" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<title>Arc90.com</title>