Skip to content

Instantly share code, notes, and snippets.

View thedanielforum's full-sized avatar

Daniel Dyrnes thedanielforum

View GitHub Profile
@thedanielforum
thedanielforum / padding.txt
Created May 5, 2022 04:30
Tailwind padding
m-0 margin: 0px;
mx-0 margin-left: 0px;
margin-right: 0px;
my-0 margin-top: 0px;
margin-bottom: 0px;
mt-0 margin-top: 0px;
mr-0 margin-right: 0px;
mb-0 margin-bottom: 0px;
ml-0 margin-left: 0px;
m-px margin: 1px;
@thedanielforum
thedanielforum / cloudSettings
Created November 6, 2019 02:38
Visual Studio Code Settings Sync Gist
{"lastUpload":"2019-11-06T02:38:06.525Z","extensionVersion":"v3.4.3"}
@thedanielforum
thedanielforum / range-font-size-scaler.js
Created May 31, 2019 03:47
This code is a pice of 💩and should not be used unless you are planing to fix it up a bit.
// Input must be sorted in asc order
const input = [3, 8, 20, 25];
let output = [];
const minmax = [10, 30];
let distances = [];
for (let i = 0; i < input.length; i++) {
if ((i + 1) < input.length) {
if (input[i] > input[i + 1]) {
@thedanielforum
thedanielforum / cloudbuild.yaml
Created April 12, 2019 01:20
Google cloud build configuration file for deploying a react app to firebase hosting
steps:
- name: 'gcr.io/cloud-builders/yarn'
args: ['install']
- name: 'gcr.io/cloud-builders/npm'
args: ['run', 'lint']
- name: 'gcr.io/cloud-builders/npm'
args: ['run', 'test']
env:
- 'CI=true'
- name: 'gcr.io/cloud-builders/npm'
@thedanielforum
thedanielforum / index.html
Created April 4, 2019 16:48
Example landing page
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<title>Example webpage</title>
@thedanielforum
thedanielforum / access.json
Created April 4, 2019 16:07
AWS S3 Website public bucket read policy
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublicReadGetObject",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::simplelandingpage.com/*"
}
@thedanielforum
thedanielforum / requireAuth.jsx
Created April 4, 2019 09:26
React HOC for enforcing authentication on react-router routes.
import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
export default function (ComposedComponent) {
class Authenticate extends React.Component {
static propTypes = {
isAuthenticated: PropTypes.bool.isRequired,
}
@thedanielforum
thedanielforum / MainApplication.java
Created July 30, 2018 05:15
ReactNative with RNN and Image picker
package com.sakana;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
import com.facebook.soloader.SoLoader;
import com.imagepicker.ImagePickerPackage;
import com.oblador.vectoricons.VectorIconsPackage;
import com.reactnativenavigation.NavigationApplication;
@thedanielforum
thedanielforum / config.yml
Created July 4, 2018 09:09
ReactJS, AWS, CircleCI 2.0 configuration file.
# ReactJS, AWS, CircleCI 2.0 configuration file.
version: 2
jobs:
build-job:
docker:
# specify the version you desire here
- image: circleci/node:7.10
working_directory: ~/repo
@thedanielforum
thedanielforum / .editorconfig
Created February 28, 2018 01:22
ReactJS - .editorconfig
# http://EditorConfig.org
root = true
# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 2