Skip to content

Instantly share code, notes, and snippets.

View macintoshhelper's full-sized avatar
🇺🇦
Learning Python

macintoshhelper

🇺🇦
Learning Python
View GitHub Profile
@macintoshhelper
macintoshhelper / start_tmux_windows.sh
Created January 8, 2024 22:08
tmux split window script x6
#!/bin/bash
# Start a new tmux session
tmux new-session -d -s mysession
# Split panes and arrange them in a 2x3 grid
tmux split-window -h
tmux split-window -h
tmux select-layout even-horizontal
tmux split-window -v
@macintoshhelper
macintoshhelper / split-zip.sh
Created September 23, 2022 14:37
Split zip into chunks (for FAT32)
zip input.zip --out split-file-output.zip -s 2g
@macintoshhelper
macintoshhelper / AppWithAnalytics.js
Last active October 13, 2020 17:12
React Google Analytics with GDPR consent
import React from 'react';
import CookieConsent, { Cookies } from 'react-cookie-consent';
import useAnalytics from './use-analytics';
const App = () => {
const { sendPageView } = useAnalytics();
useEffect(() => {
sendPageView('/'); // should noop if consent not given (as visitor object is not initialised)
}, [sendPageView])
@macintoshhelper
macintoshhelper / react-sketchapp-breakpoints-app.js
Last active May 1, 2020 22:33
[WIP] react-sketchapp responsive breakpoints
import { Page, Artboard, View, Text, useWindowDimensions } from 'react-sketchapp';
const breakpoints = [360, 768, 1024];
const getBreakpoint = (width) => {
for (let i = 0; i < breakpoints.length - 1; i += 1) {
if (width <= breakpoints[i]) {
return i;
}
}
@macintoshhelper
macintoshhelper / ssh-cheatsheet.md
Last active January 2, 2022 13:29
SSH Cheatsheet

ssh-cheatsheet

Bash SSH command cheatsheet

Connecting to Remote Host From Local Client

SSH

SSH into a remote server.

@macintoshhelper
macintoshhelper / initcert.sh
Created May 7, 2017 10:06
Initialise fake SSL certificate for localhost
openssl genrsa -out key.pem 2048
openssl req -new -key key.pem -out csr.pem -subj "/C=US/ST=None/L=None/O=None/CN=localhost"
openssl x509 -req -days 9999 -in csr.pem -signkey key.pem -out cert.pem
rm csr.pem
mkdir keys
mv cert.pem keys/cert.pem
mv key.pem keys/key.pem
echo 'keys/' >> .gitignore