Skip to content

Instantly share code, notes, and snippets.

View IAMAdamN's full-sized avatar
💙
Blah blah blah

Adam IAMAdamN

💙
Blah blah blah
View GitHub Profile
@DaveDevYT
DaveDevYT / httpd-vhosts.conf
Last active April 23, 2023 03:38
Apache Virtual Host Configuration
<VirtualHost dev.example.com:80>
ServerName dev.example.com
DocumentRoot "C:/xampp/htdocs/dev.example.com/public"
<Directory "C:/xampp/htdocs/dev.example.com/public">
Require all granted
AllowOverride All
</Directory>
ErrorLog "logs/dev.example.com-error.log"
CustomLog "logs/dev.example.com-access.log" combined
@jmabbas
jmabbas / style.css
Created June 29, 2021 06:37
Electro - Color mode switcher in mobile view
.electro-mode-switcher {
display: flex;
}
@obokaman-com
obokaman-com / start_ngrok_update_cloudflare.sh
Created December 4, 2020 19:32
Script to start ngrok, copy the generated URL to clipboard and update a remote Cloudflare worker with the public ngrok url
#!/usr/bin/env bash
echo "=========== START LOCAL HTTP / HTTPS TUNNEL AND UPDATE YOUR REMOTE DEV DOMAIN TO POINT IT ==========="
printf "\n"
# Start NGROK in background
echo "⚡️ Starting ngrok"
ngrok http 8080 > /dev/null &
# Wait for ngrok to be available
while ! nc -z localhost 4040; do
@AndrewMast
AndrewMast / disable_vanguard.vbs
Last active July 23, 2024 20:42
Commands to disable Riot Vanguard when you aren't playing Valorant
' Disables Vanguard from starting when you boot your computer
Call CreateObject("Shell.Application").ShellExecute("cmd.exe", "/c ""sc config vgc start= disabled & sc config vgk start= disabled""", "", "runas")
add_filter( 'woocommerce_shipment_tracking_default_provider', 'custom_woocommerce_shipment_tracking_default_provider' );
function custom_woocommerce_shipment_tracking_default_provider( $provider ) {
$provider = 'USPS';
return $provider;
}
#if UNITY_EDITOR
using System;
using System.Reflection;
using UnityEditor;
using UnityEngine;
/// <summary>
/// Little utility for opening a "Game" view in fullscreen. Will be opened on whatever Unity thinks is the "main"
/// monitor at the moment. The hotkey will toggle the window; however, if for some reason this breaks, fullscreen
@natanfelles
natanfelles / text_helper.php
Created February 20, 2020 23:12
HTML Purifier Helper for TinyMCE
<?php
/**
* @param string $content
*
* @return string
*/
function purify(string $content) : string
{
$config = \HTMLPurifier_Config::createDefault();
$config->set('HTML.AllowedElements', [
@nklatt
nklatt / 0 intro.txt
Last active July 1, 2023 15:13
Import Google Maps polygons into MySQL
We have a client that ships from multiple warehouses using zones to determine
pricing. They maintain the zones in a Goole Maps document. We are creating a
front end that clients can enter their address and we'll show them what their
shipping options are. We will have the client export their zones as a KML
file and we'll import it into a MySQL database and use ST_Contains to find
the shipping zone(s) customers are in. (They can only be in one zone for any
given warehouse but may be within range of multiple warehouses.)
One thing to point out is there is confusion about the order of latitude and
longitude. Mathematically, it is naturally ordered "longitude, latitude" but

MySQL Cheat Sheet

Help with SQL commands to interact with a MySQL database

MySQL Locations

  • Mac /usr/local/mysql/bin
  • Windows /Program Files/MySQL/MySQL version/bin
  • Xampp /xampp/mysql/bin

Add mysql to your PATH