Skip to content

Instantly share code, notes, and snippets.

View StoneyEagle's full-sized avatar
🦅

Stoney_Eagle StoneyEagle

🦅
View GitHub Profile
@StoneyEagle
StoneyEagle / cloudSettings
Last active February 11, 2020 12:45
VScode Settings
{"lastUpload":"2020-02-11T12:45:25.900Z","extensionVersion":"v3.4.3"}
@StoneyEagle
StoneyEagle / tmdb.js
Last active August 17, 2022 23:43
Get all Netflix shows and movies
//axiosclient
import axios from 'axios';
const tmdbApiClient = axios.create();
tmdbApiClient.defaults.baseURL = 'https://api.themoviedb.org/3/';
tmdbApiClient.defaults.timeout = 1000 * 60 * 5;
tmdbApiClient.interceptors.request.use(
async (conf) => {
@StoneyEagle
StoneyEagle / base.mjs
Last active August 17, 2022 23:46
NodeJs Socket.io template
import http from 'http';
import {socket} from './socket.mjs';
export default async (app) => {
let httpsServer = https.createServer(credentials, app);
httpsServer
.listen(config.secureInternalPort, '0.0.0.0', () => {
@StoneyEagle
StoneyEagle / App.jsx
Last active January 24, 2022 07:51
React SocketProvider
import React, { useState } from 'react';
import { useSocket } from "./constext/SocketProvider";
function App() {
const socket = useSocket();
const [data, setData] = useState([]);
useEffect(() => {
if (socket) {
:root {
--col-deg: 265deg;
--col-sat: 50%;
--col-bright: 90%;
--bg-deg: 265deg;
--bg-sat: 1%;
--bg-bright: 60%;
--theme-color: hsl(var(--col-deg), calc(var(--col-sat) / 100 * 100), calc((var(--col-bright) / 100) * 50));
--gradient-color: hsl(var(--bg-deg), calc(var(--bg-sat) / 100 * 70), calc((var(--bg-bright) / 100) * 30));
import React, { createContext, useContext, useEffect, useState } from 'react';
import io, { Socket } from 'socket.io-client';
import { useSelector, useStore } from 'react-redux';
import SocketEvents from './SocketEvents';
export const SocketContext = createContext();
export const useSocket = () => useContext(SocketContext);
@StoneyEagle
StoneyEagle / loop.jsx
Last active August 17, 2022 23:44
React loop component
import react, {useEffect, useState} from 'react';
function Looper() {
const [number, setNumber] = useState(0);
useEffect(() => {
let newNumber = 0;
const interval = setInterval(() => {
@StoneyEagle
StoneyEagle / redux_content_actions.js
Created September 14, 2022 01:00
Redux base template
// ./redux/content/actions.js
import { store } from '..';
import content from './content';
export const setLoading = (payload) => store.dispatch(content.actions.setContentLoading(payload));
export const setError = (payload) => store.dispatch(content.actions.setContentError(payload));
export const setInfo = (payload) => store.dispatch(content.actions.setInfo(payload));
@StoneyEagle
StoneyEagle / deploy.js
Created November 21, 2022 11:01
Digital Ocean deploy script
/* eslint-disable no-undef */
/* eslint-disable @typescript-eslint/no-var-requires */
const { readFileSync } = require('fs');
const { Client } = require('node-scp');
const { join } = require('path');
const env = require('dotenv');
env.config();
@StoneyEagle
StoneyEagle / trickle.scss
Last active January 11, 2023 12:10
Trickle show images
// image
.trickle-div {
transition: all;
transition-delay: var(--delay1);
transition-duration: 300ms;
}
// itemcontainer
@for $i from 1 to 100 {
.trickle > *:nth-child(#{$i}) {