Skip to content

Instantly share code, notes, and snippets.

View vallamost's full-sized avatar
🐙
DEPLOYYYYYY

Ian vallamost

🐙
DEPLOYYYYYY
View GitHub Profile
@vallamost
vallamost / livingPostgresNotes.md
Last active April 4, 2025 17:19
Live Notes - Postgres

Monitoring

Good postgres monitoring tool:

sudo apt install pg_activity

Usage: pg_activity -U testuser -h localhost -d testdb

Postgres Container Creation

@vallamost
vallamost / App.tsx
Last active March 31, 2025 20:24
Load a google font from a local file without blocking page rendering (App.tsx example). This will improve your page speed scores.
export function App() {
useEffect(() => {
// Load Google Fonts locally instead of using a 3rd party resource
const fontFace = new FontFace(
'Inter',
'url(/Inter-VariableFont.ttf)' // Ensure the font file is in the public directory (download the font and put it in your public folder)
);
// Your index.css should specify the local font like this
// :root {
@vallamost
vallamost / nextJS-cache-idea-missing-es6-typescript.js
Last active July 22, 2024 05:21 — forked from leanazulyoro/server.js
Next.js SSR Cache using LRU Cache
const express = require('express')
const next = require('next')
const Cache = require('lru-cache');
const compression = require('compression')
const port = parseInt(process.env.PORT, 10) || 3000
const dev = process.env.NODE_ENV !== 'production'
const app = next({ dev })
@vallamost
vallamost / gist:4b9b8ec0ec1d1509bf7aa5ece42a8a4f
Created February 6, 2023 21:36
Select an entire JSON object if a value in the array contains a specific string
jq -r '.[] | select(.project_url | contains("stringValueToFilterInproject_url"))' ./tmp/appid_analytic_data_raw.json
@vallamost
vallamost / getMatchFromDescription.sh
Last active June 9, 2020 21:52
Grab value out of AMI Description from AWS EC2 describe AMI call via AWS CLI
#!/bin/bash
# For a list of EC2 AMI IDs in a file, find something in each of the AMI description attributes and capture the characters after it.
# Then output it in JSON.
# Replace 'SAMBA' with the string you want to search for.
# ami file of ids example:
#
# ami-a231212
# ami-sf12518agsj2l31
import 'package:flutter/cupertino.dart';
import 'package:speech_to_text/speech_recognition_error.dart';
import 'package:speech_to_text/speech_recognition_result.dart';
import 'package:speech_to_text/speech_to_text.dart';
class VoiceFunctions extends ChangeNotifier {
bool speechEngineState = false;
final speechTimeoutDuration = Duration(seconds: 5);
double level = 0.0;
String lastWords = "";
@vallamost
vallamost / Download and Install the latest version of Flutter on Windows and add it to the path via the CLI.md
Last active May 13, 2020 04:08
Download and Install the latest version of Flutter on Windows and add it to the path via the CLI

Download and Install the latest version of Flutter on Windows and add it to the path via the CLI

Requires git for CMD Installs flutter to a folder named flutter on the desktop. Appends the flutter\bin folder to your current Windows PATH variable.

Open CMD in administrative mode, not powershell.

cd %USERPROFILE%/Desktop
@vallamost
vallamost / settings.json
Last active May 13, 2020 03:24
My favorite Windows Terminal Default Config
// uses dark mode, sane hot keys, starting directory as desktop, 4k friendly font size, large history,
// This file was initially generated by Windows Terminal 0.11.1251.0
// It should still be usable in newer versions, but newer versions might have additional
// settings, help text, or changes that you will not see unless you clear this file
// and let us generate a new one for you.
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
@vallamost
vallamost / gist:7d9638a1d54d2bf7ef84a43f7342197a
Last active May 7, 2020 16:00
AndroidManifest Fix for flutter location plugin
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.your_app_name"
xmlns:tools="http://schemas.android.com/tools"> <!-- newly added -->
<application
tools:replace="android:label" <!-- newly added -->
android:name="io.flutter.app.FlutterApplication"
...
@vallamost
vallamost / gist:f10f043e7a300d6ef1b44e88765a4131
Created May 3, 2020 23:31
2020 - OpenVPN + FreeIPA Configs
#configure freeIPA and generate certs +
https://gist.github.com/rechner/c6b9133b7816445b5850f8e22e16aa60
# generate certs from freeIPA
sudo ipa-getcert request -K openvpn/`hostname` -k /etc/openvpn/server_freeipa.key -f /etc/openvpn/server_freeipa.crt -I openvpn -C /usr/local/sbin/set-ssl-permissions
#openvpn server config
local <addressToBindTo>
port 1194