Skip to content

Instantly share code, notes, and snippets.

View dayhaysoos's full-sized avatar
🏠
Working from home

Nick DeJesus dayhaysoos

🏠
Working from home
View GitHub Profile
@dayhaysoos
dayhaysoos / gulpfile.js
Created August 28, 2015 17:14
gulp file for React
'use strict';
var production = false;
// Module Requires
var path = require('path');
var gulp = require('gulp');
var gulpif = require('gulp-if');
var source = require('vinyl-source-stream');
var browserify = require('browserify');
@dayhaysoos
dayhaysoos / gulpfile.js
Created August 28, 2015 17:16
gulp file angular
'use strict';
var production = false;
// Module Requires
var path = require('path');
var gulp = require('gulp');
var gulpif = require('gulp-if');
var source = require('vinyl-source-stream');
var browserify = require('browserify');
@dayhaysoos
dayhaysoos / package.json
Last active October 25, 2015 16:51
package.json for React
{
"name": "whatever",
"version": "1.0.0",
"main": "main.js",
"private": true,
"scripts": {
"build": "gulp and browserify",
"start": ""
},
"keywords": [
@dayhaysoos
dayhaysoos / package.json
Created August 28, 2015 17:19
package.json for angular
{
"name": "js",
"version": "1.0.0",
"description": "",
"main": "fizzbuzz.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style id="jsbin-css">
.tall{
height: 1000px
}
@dayhaysoos
dayhaysoos / eject.md
Created March 10, 2017 13:22
eject command for React Native

Reconfigure

If your project has any issues with the native folders, you can rebuild them by deleting both the ios and android directories at the root level of your project and running this command:

$ react-native eject

Running this command will check if the ios and android directories exist and then rebuild whichever one is missing.

The first time you run this command it will spit out a configuration JSON file called app.json. By default, app.json will have 2 properties:

Edge Cases for Pull Request #12649 on React Native

facebook/react-native#12649 (comment)

-Run eject without icon key

Default behavior. Android uses Android logo for the icon and iOS produces the place holder icon as expected.

-Run eject with icon object, default property with a path name to standard icon

iOS and Android platforms get same exact image for app icon as expected

@dayhaysoos
dayhaysoos / urlUpdater.js
Created December 15, 2018 18:50
Script I made to get the correct letter casing for gfycat URLs
const fs = require('fs')
const axios = require('axios');
const path = require('path');
const JSON_DIR = path.join(__dirname, 'json');
const jsonFiles = fs.readdirSync(JSON_DIR).filter(dir => dir.includes('.json'))
gifNameGetter = async (previewUrl) => {
@dayhaysoos
dayhaysoos / sku.js
Created August 27, 2019 21:03
context stuff
/** @jsx jsx */
import React, { Component } from 'react';
import { Styled, jsx } from 'theme-ui'
import { useSkus, CartProvider } from '../context/shopping-cart';
const Sku = (props) => {
console.log(props)
const redirectToCheckout = async (event) => {
import React from 'react'
import { Box } from 'theme-ui'
import { keyframes } from '@emotion/core'
// Default color is a bright yellow
const DEFAULT_COLOR = 'hsl(50deg, 100%, 50%)'
const range = (start, end, step = 1) => {
let output = []