Skip to content

Instantly share code, notes, and snippets.

@58bits
58bits / multipart.js
Created August 15, 2020 02:02
MultiPart Handler
'use strict'
const config = require('../../config')
const { MultipartError } = require('./errors')
const fs = require('fs')
const path = require('path')
const nanoid = require('nanoid')
const Multipart = (request, response, done) => {
// Note: onFile and addToBody cannot be handled on a per reuqest basis at the moment
@58bits
58bits / CustomThemeProvider.js
Created May 26, 2020 17:22
CustomThemeProvider
// https://techinscribed.com/building-react-app-using-material-ui-with-support-for-multiple-switchable-themes/
import React, { useState } from 'react'
import { ThemeProvider } from '@material-ui/core/styles'
import getTheme from './base'
// eslint-disable-next-line no-unused-vars
export const CustomThemeContext = React.createContext(
{
currentTheme: 'normal',
setTheme: null,
@58bits
58bits / pc-2-update.md
Created January 6, 2020 02:09
PC-2-Update

Intel® Core™ i9-7900X X-series Processor 8 Cores 12M Cache, up to 4.60 GHz https://ark.intel.com/content/www/us/en/ark/products/123613/intel-core-i9-7900x-x-series-processor-13-75m-cache-up-to-4-30-ghz.html

ASUS PRIME X299-DELUXE LGA2066 DDR4 M.2 U.2 THUNDERBOLT USB 3.1 X299 ATX Motherboard with Dual Gigabit LAN and 802.11AD WIFI for Intel® Core™ i7 X-Series Processors https://www.asus.com/us/Motherboards/PRIME-X299-DELUXE/

Corsair Crystal Series 460X RGB Compact ATX Mid-Tower Case http://www.corsair.com/en-eu/crystal-series-460x-rgb-compact-atx-mid-tower-case

Corsair ML120 PRO LED CO-9050042-WW 120mm Premium Magnetic Levitation PWM Fan -for rear chassis fan on the 460X above http://www.corsair.com/en-eu/ml120-pro-led-red-120mm-premium-magnetic-levitation-fan

Super Flower Leadex II Gold 750W (Black) http://www.super-flower.com.tw/index.php?lang=en

@58bits
58bits / composer.json
Created November 19, 2019 08:05
Codesnippet library
{
"type": "package",
"package": {
"name": "ckeditor/codesnippet",
"version": "4.11.4",
"type": "drupal-library",
"extra": {
"installer-name": "codesnippet"
},
"dist": {
@58bits
58bits / tmux-functions.sh
Created December 15, 2017 21:55
tmux-functions.sh
#!/bin/bash
set -e
export LC_NUMERIC=C
__newline='
'
_is_enabled() {
( ([ x"$1" = x"enabled" ] || [ x"$1" = x"true" ] || [ x"$1" = x"yes" ] || [ x"$1" = x"1" ]) && return 0 ) || return 1
@58bits
58bits / pc2.md
Created November 15, 2017 15:44
PC 2

Intel® Core™ i7-7820X X-series Processor 8 Cores 12M Cache, up to 4.60 GHz https://ark.intel.com/products/123767/Intel-Core-i7-7820X-X-series-Processor-11M-Cache-up-to-4_30-GHz

ASUS PRIME X299-DELUXE LGA2066 DDR4 M.2 U.2 THUNDERBOLT USB 3.1 X299 ATX Motherboard with Dual Gigabit LAN and 802.11AD WIFI for Intel® Core™ i7 X-Series Processors https://www.asus.com/us/Motherboards/PRIME-X299-DELUXE/

Corsair Crystal Series 460X RGB Compact ATX Mid-Tower Case http://www.corsair.com/en-eu/crystal-series-460x-rgb-compact-atx-mid-tower-case

Corsair ML120 PRO LED CO-9050042-WW 120mm Premium Magnetic Levitation PWM Fan -for rear chassis fan on the 460X above

{
"data":[
{
"id":1,
"name":"Hic qui ipsa dicta itaque architecto.",
"created_at":"2016-12-02T08:36:09+0000",
"updated_at":"2016-12-02T08:36:09+0000",
"category":{
"data":{
"id":1,
import { isArray } from 'lodash'
import { decode, encode } from 'querystring'
const DEBUG = true
const DEBUG_SESSION = 10942
export default (http, store, router) => {
// Add a request interceptor
http.interceptors.request.use((config) => {
// PhpStorm needs to be started first, and a debug session
{
"uri": "http://0.0.0.0:9233/api/v1/users",
"links": {
"about": {
"href": "http://path.to/user/resource/1"
},
"describes": {
"href": "http://path.to/describes"
},
"help": {
<?php
/*************************************************************
* Prepares variables for the html.html.twig template.
* @param $variables
*/
function basic_preprocess_html(&$variables) {
try {
$variables['is_front'] = \Drupal::service('path.matcher')->isFrontPage();
}
catch (Exception $e) {