Skip to content

Instantly share code, notes, and snippets.

View IcodeNet's full-sized avatar
😀

Byron Thanopoulos IcodeNet

😀
View GitHub Profile
@IcodeNet
IcodeNet / gist:8a218898b3dddfea52d0b0bb807dd627
Created November 13, 2023 09:15 — forked from SackeyDavid/gist:d24315dd844d51b3e70af062fdcf5941
Turing Coding Challenge Practise Test - Problem 2
// console.log("Hello, World!");
var countElements = function(arr) {
var result = 0;
// output = 0;
// count elements
for (var i = 0; i < arr.length; i++) {
if(arr.includes(arr[i] + 1)) {
result+= 1
}
# Interview Question Practice
## Iteration 1
- Describe the difference between a cookie, sessionStorage and localStorage. [-hint-](https://github.com/turingschool/lesson_plans/blob/3ee469be5fdc94c926a88ca510106848b0339731/ruby_04-apis_and_scalability/client_side_storage.markdown) [web APIs]
- What are `data-` attributes good for? [-hint-](https://css-tricks.com/almanac/selectors/a/attribute/) [html]
- Have you used or implemented media queries or mobile specific layouts/CSS? [-hint-](http://frontend.turing.io/lessons/module-1/intro-responsive.html) [css]
@IcodeNet
IcodeNet / upload.js
Created March 3, 2022 12:32 — forked from ibreathebsb/upload.js
file upload from dataUrl with axios
// Note: only for modern browser
import axios from 'axios'
// helper function: generate a new file from base64 String
const dataURLtoFile = (dataurl, filename) => {
const arr = dataurl.split(',')
const mime = arr[0].match(/:(.*?);/)[1]
const bstr = atob(arr[1])
let n = bstr.length
const u8arr = new Uint8Array(n)
@IcodeNet
IcodeNet / Example.tsx
Created August 17, 2021 08:30 — forked from stolinski/Example.tsx
Route Transitions with Framer Motion
const FakeComponent = () => {
return (
<AnimatedRoutes exitBeforeEnter initial={false}>
<RouteTransition exact path="/some-route">
<NewUsers />
</RouteTransition>
<RouteTransition exact path="/yo" >
<Users />
</RouteTransition>
</AnimatedRoutes>
@IcodeNet
IcodeNet / on-jsx.markdown
Created April 27, 2021 08:42 — forked from chantastic/on-jsx.markdown
JSX, a year in

Hi Nicholas,

I saw you tweet about JSX yesterday. It seemed like the discussion devolved pretty quickly but I wanted to share our experience over the last year. I understand your concerns. I've made similar remarks about JSX. When we started using it Planning Center, I led the charge to write React without it. I don't imagine I'd have much to say that you haven't considered but, if it's helpful, here's a pattern that changed my opinion:

The idea that "React is the V in MVC" is disingenuous. It's a good pitch but, for many of us, it feels like in invitation to repeat our history of coupled views. In practice, React is the V and the C. Dan Abramov describes the division as Smart and Dumb Components. At our office, we call them stateless and container components (view-controllers if we're Flux). The idea is pretty simple: components can't

@IcodeNet
IcodeNet / cognito.spec.js
Created January 15, 2021 07:31 — forked from wordyallen/cognito.spec.js
Testing Cognito
require('dotenv').config()
import {exec} from 'child_process'
import {
CognitoUserPool as Pool,
CognitoUserAttribute as Attribute,
CognitoUser as User,
AuthenticationDetails as Details,
} from 'amazon-cognito-identity-js'
import {LocalStorage} from 'node-localstorage'
import prompt from 'prompt'
@IcodeNet
IcodeNet / npm-upgrade-bleeding.sh
Created November 5, 2020 07:58 — forked from othiym23/npm-upgrade-bleeding.sh
a safe way to upgrade all of your globally-installed npm packages
#!/bin/sh
set -e
set -x
for package in $(npm -g outdated --parseable --depth=0 | cut -d: -f3)
do
npm -g install "$package"
done
@IcodeNet
IcodeNet / ContextCmder-Disable.reg
Created August 1, 2019 09:47 — forked from jojobyte/ContextCmder-Disable.reg
Cmder Context (Right-Click) Menu for Windows 7, 8 & 10
Windows Registry Editor Version 5.00
[-HKEY_CLASSES_ROOT\Directory\Background\shell\Cmder]
[-HKEY_CLASSES_ROOT\Directory\shell\Cmder]
@IcodeNet
IcodeNet / npm-commands.md
Created July 30, 2019 11:16 — forked from ankurk91/npm-commands.md
Useful npm commands and tricks

npm v3.10 - ◾

If you are learning npm then i would suggest to go for yarn, dont waste your time in learning npm

⚠️ This gist is outdated, but most of the commands are still relevant.

Update npm itself

npm install -g npm
# Downgrade to a specific version
@IcodeNet
IcodeNet / materialUiStyles.js
Created July 5, 2019 09:07 — forked from mbixby/materialUiStyles.js
Extending Material UI styles
import { merge } from 'lodash'
// This module allows us to completely customize all of Material UI's JSS stylesheets
// to define our own theme.
//
// Note that you Material UI's JSS is often tied to application logic and you may
// deviate from the official Material UI spec.
//
// Unlike using the `overrides` feature of jss-theme-reactor, here you have access to
// the original calculated styles and theme. Notably you can do deep merge (lodash.merge)