Skip to content

Instantly share code, notes, and snippets.

// @mui/x-date-pickers: 8.22.1
// @mui/joy: 5.0.0-beta.52
// @mui/material: 7.3.6
import { Fragment } from 'react/jsx-runtime';
import { ThemeProvider, createTheme } from '@mui/material/styles';
import { CssVarsProvider, THEME_ID } from '@mui/joy/styles';
import Input from '@mui/joy/Input';
import IconButton from '@mui/joy/IconButton';
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
@ofekashery
ofekashery / main.js
Last active May 21, 2024 21:41
React Router Global Manipulation
/**
* This navigate function is designed to programmatically manipulate and navigate within
* a React application using React Router from standalone context.
*
* It leverages the browser's History API to update the URL without causing a full page
* reload and dispatches a popstate event to ensure React Router updates the UI accordingly.
*/
const navigate = (path) => {
if (window.history && window.history.pushState) {
// Use the browser's History API to manipulate the location
@ofekashery
ofekashery / timer.js
Created October 27, 2023 09:37
FIRST Tech Challenge Timer class
/* Copyright (c) 2018 FIRST, Thomas Barnette, George Marchant, and Trey Woodlief. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted (subject to the limitations in the disclaimer below) provided that
* the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this list
* of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice, this
const fetch = require('node-fetch');
const schedule = require('node-schedule');
////////////////////////////////////////////
const config = {
username: '',
password: '',
schoolId: 000000
};
const fetch = require('node-fetch');
const https = require('https');
const agent = new https.Agent({
rejectUnauthorized: false
});
const config = {
email: '',
password: '',
#!/bin/bash
TGTFILE="./FIRST-Tech-Challenge-Live -u"
# Bash Title
echo -en "\033]0;FIRST Tech Challenge Live\a"
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
cd "${DIR}"
cd bin
echo "Welcome to FIRST Tech Challenge Live!"
Array.from(document.querySelectorAll('.ellipsis-more')).forEach(btn => btn.click());
Array.from(document.querySelectorAll('[ng-click="vm.deleteDevice(item)"]')).forEach(btn => btn.click());
Array.from(document.querySelectorAll('[ng-click="dialog.hide()"]')).forEach(btn => btn.click());
@ofekashery
ofekashery / hex-opacity-values.md
Created January 8, 2019 13:56
Hex Opacity Values

Hex Opacity Values

  • 100% — FF
  • 95% — F2
  • 90% — E6
  • 85% — D9
  • 80% — CC
  • 75% — BF
  • 70% — B3
  • 65% — A6
@ofekashery
ofekashery / chrome-dino.js
Last active April 3, 2020 13:34
Hacking the Chrome Dino Game.
Runner.prototype.gameOver = function(){}
Runner.instance_.setSpeed(1000)
@ofekashery
ofekashery / isFirstTime.java
Last active June 22, 2018 10:46
Check if this is the first time the user has opened your app
public static boolean isFirstTime(Context context) {
SharedPreferences preferences = context.getSharedPreferences("firstTimeSP", Context.MODE_PRIVATE);
boolean firstTime = preferences.getBoolean("firstTime", true);
if (firstTime) {
// first time
SharedPreferences.Editor editor = preferences.edit();
editor.putBoolean("firstTime", false);
editor.commit();
}
return firstTime;