Skip to content

Instantly share code, notes, and snippets.

View mpaccione's full-sized avatar
🎯
Focusing

Michael Paccione mpaccione

🎯
Focusing
View GitHub Profile
import React from "react";
import Plot from "react-plotly.js";
const BarChart = ({ arr = false, obj, rect, title }) => {
if (!rect) {
return null;
}
const { height, width } = rect;
//////////////////
// INSTRUCTIONS //
//////////////////
// Given the root of a binary tree, check whether it is a mirror of itself (i.e., symmetric around its center).
// Input: root = [1,2,2,3,4,4,3]
// Output: true
// Input: root = [1,2,2,null,3,null,3]
@mpaccione
mpaccione / snippet.js
Created October 13, 2021 22:27
Snippet
const Keen = new KeenAnalysis({
projectId: config.getString('keen.libraryClient.projectId'),
masterKey: config.getString('keen.masterKey')
})
...
const keenURL = {
url: Keen.url('events'),
api_key: Keen.masterKey(),
@mpaccione
mpaccione / .js
Created August 18, 2021 03:34
CSRF
CSRFProtection: (req, publicRoutes = false) => {
if (req.headers['x-sboauth']) {
const userProfile = jwt_decode(req.headers['x-sboauth']);
console.log('============ USER PROFILE FROM SBOAUTH ============');
console.log({ userProfile });
req.user = userProfile;
return;
}
if (publicRoutes) {
@mpaccione
mpaccione / .js
Created August 18, 2021 03:21
cookie.js
router.post('/cookie', (req, res) => {
const localhost = req.headers.referer.includes('localhost');
const decodedJWT = jwt_decode(req.body.token);
let expiration = decodedJWT.expiration;
expiration = Number(expiration);
expiration =
typeof expiration === 'number' && expiration > Date.now()
? expiration
: new Date(Date.now() + TEN_HOURS);
import React from "react";
import { Button as SemanticButton } from "semantic-ui-react";
import styled from "styled-components";
const BaseButton = styled(SemanticButton)`
color: white !important;
font-family: Rubik, sans-serif !important;
font-weight: 800 !important;
&.disabled {
package com.vuzix.blade.devkit.sensors_sample;
import android.content.Context;
import android.hardware.Sensor;
import android.hardware.SensorEvent;
import android.hardware.SensorEventListener;
import android.hardware.SensorManager;
import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;
@mpaccione
mpaccione / log.txt
Created May 19, 2021 04:27
Bluetooth Logs
mpaccione@mpaccione:~/Projects/ARGlasses/vuzix$ systemctl enable bluetooth
Synchronizing state of bluetooth.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable bluetooth
mpaccione@mpaccione:~/Projects/ARGlasses/vuzix$ systemctl status blueooth
Unit blueooth.service could not be found.
mpaccione@mpaccione:~/Projects/ARGlasses/vuzix$ journalctl -xe
May 18 21:21:22 mpaccione polkitd(authority=local)[1628]: Unregistered Authentication Agent for unix-process:21290:499588 (system bus name :1.712, object path /org/freed>
May 18 21:21:22 mpaccione polkitd(authority=local)[1628]: Registered Authentication Agent for unix-process:21327:499856 (system bus name :1.716 [/usr/bin/pkttyagent --no>
May 18 21:21:23 mpaccione systemd[1]: apt-daily.service: Succeeded.
░░ Subject: Unit succeeded
@mpaccione
mpaccione / debug-output.txt
Created May 14, 2021 17:36
dunst -verbosity debug
WARNING: Unknown mouse action value: 'do_action, close_current'
Xlib: extension "XINERAMA" missing on display ":0".
WARNING: Could not get xinerama screen info. Falling back to single monitor mode.
DEBUG: RUN
Xlib: extension "RANDR" missing on display ":0".
DEBUG: XEvent: Ignoring '65'
DEBUG: XEvent: processing 'CreateNotify'
DEBUG: XEvent: Checking for active screen changes
DEBUG: XEvent: Checking for active screen changes
Xlib: extension "RANDR" missing on display ":0".
@mpaccione
mpaccione / extensions.txt
Created May 14, 2021 17:32
xdpyinfo -queryExtensions output
name of display: :0
version number: 11.0
vendor string: The X.Org Foundation
vendor release number: 12009000
X.Org version: 1.20.9
maximum request size: 16777212 bytes
motion buffer size: 256
bitmap unit, bit order, padding: 32, LSBFirst, 32
image byte order: LSBFirst
number of supported pixmap formats: 7