Skip to content

Instantly share code, notes, and snippets.

View traumverloren's full-sized avatar
🐢

Stephanie traumverloren

🐢
View GitHub Profile
# update system
$ sudo apt update && sudo apt upgrade
# uninstall old node (v10?)
$ sudo apt remove nodejs npm -y
# install nvm
$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash
# use 'unofficial builds' in nvm
@mislav
mislav / windows-on-mac.md
Last active February 21, 2024 23:38
Install Windows 11 in a virtual machine on macOS with an M1 CPU

Based on https://docs.getutm.app/guides/windows/

  1. You will need:
    • A Windows 10 or Windows 11 license key;
    • UTM for Mac - the App Store version is offered as a way to support the developers, since it's paid, but has the same features as the free build.
  2. Obtain scripts that bootstrap an arm64 Windows 11 22H2 (I've chosen Windows Home edition and not Pro);
  3. brew install aria2 cabextract wimlib cdrtools minacle/chntpw/chntpw;
  4. cd into the directory extracted in step 1 and bash uup_download_macos.sh - this will produce an ISO;
  5. In the UTM app, create a new “Virtualize” machine and mount the ISO file from the previous step;
  6. Check “Install drivers and SPICE tools”;
@mandrean
mandrean / install-nodejs-lts-raspberry-pi-zero-w-armv6
Created November 7, 2022 11:22
Install NodeJS LTS on Raspberry Pi Zero W (ARMv6)
# update system
$ sudo apt update && sudo apt upgrade
# uninstall old node (v10?)
$ sudo apt remove nodejs npm -y
# install nvm
$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash
# use 'unofficial builds' in nvm
@yacafx
yacafx / default
Last active February 9, 2023 20:07
NGNIX configuration for run node app and php app at the same same time - This configuration made Node and Wordpress working at the same time on two different routes.
### /etc/nginx/sites-available/default
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
index index.html index.htm index.php;
@jpwesselink
jpwesselink / react-redux-simplified.jsx
Last active June 12, 2017 08:02
Simplified anatomy of a React Redux app
import React from 'react';
import { render } from 'react-dom';
import { connect, Provider } from 'react-redux';
import { createStore } from 'redux';
// Here's a reducer...
const reducer = (state = { name: 'JP' }, action) => {
switch (action.type) {
case 'SET_NEW_NAME':
return { name: action.newName };
@fokusferit
fokusferit / enzyme_render_diffs.md
Last active April 15, 2024 09:41
Difference between Shallow, Mount and render of Enzyme

Shallow

Real unit test (isolation, no children render)

Simple shallow

Calls:

  • constructor
  • render
@nginx-gists
nginx-gists / Dockerfile
Last active January 6, 2023 09:55
NGINX Plus for the IoT: Load Balancing MQTT
# Pull base image. The official docker openjdk-8 image is used here.
FROM java:8-jdk
# Copy HiveMQ to container
COPY hivemq.zip /tmp/
#Install wget and unzip, then download and install HiveMQ.
RUN \
apt-get install -y wget unzip &&\
unzip /tmp/hivemq.zip -d /opt/ &&\
@ksiggaard
ksiggaard / style.less
Last active October 23, 2017 17:31
Fira Code & Flottflott highlighting in Atom
/*
* Code by William Chang and Matt McFarland
* https://medium.com/@docodemore/an-alternative-to-operator-mono-font-6e5d040e1c7e#.ofkdp0aww
* flottflott - http://www.dafont.com/flottflott.font
* Fira Code - https://github.com/tonsky/FiraCode
*/
atom-text-editor {
font-family: 'Fira Code';
font-style: normal;
@sanusart
sanusart / localStorage.js
Last active August 1, 2020 09:03
Jest mock localStorage #test #jest
// ./__mocks__/localStorage.js
let mockStorage = {};
module.exports = window.localStorage = {
setItem: (key, val) => Object.assign(mockStorage, {[key]: val}),
getItem: (key) => mockStorage[key],
clear: () => mockStorage = {}
};
@rondagdag
rondagdag / coffeeAmazonDRS.ino
Created February 24, 2017 20:42
coffeeAmazonDRS.ino
/*******************************************************************
Check out the included Arduino sketches and the getting started
guide here!
https://github.com/andium/AmazonDRS
This is an Arduino implementation of an Amazon Dash Replenishment
device. It currently supports the critical API endpoints necessary
for registering a device and submitting replenishment requests. This
library is tightly coupled to the WiFi101 library, which means it will
work great with the Arduino MKR1000, Adafruit Feather MO w/ the ATWINC1500,