Skip to content

Instantly share code, notes, and snippets.

View mechawrench's full-sized avatar

Mechawrench mechawrench

View GitHub Profile
@mechawrench
mechawrench / lilygo_t_display_rp2040_demo.py
Created August 4, 2022 17:09 — forked from todbot/lilygo_t_display_rp2040_demo.py
show how to use LILYGO T display RP2040 board in CircuitPython w/o explicit board support
# lilygo_t_display_rp2040_demo.py - show how to use LILYGO T display RP2040 board
# 23 Jun 2022 - @todbot / Tod Kurt
# https://github.com/Xinyuan-LilyGO/LILYGO-T-display-RP2040
# https://github.com/adafruit/circuitpython/pull/6037
# Install standard Raspberry Pi Pico UF2 firmware on the board
import time, random
import board
import busio, digitalio
import displayio
diff --git a/node_modules/@remix-run/dev/compiler.js b/node_modules/@remix-run/dev/compiler.js
index 22c5ac0..d898697 100644
--- a/node_modules/@remix-run/dev/compiler.js
+++ b/node_modules/@remix-run/dev/compiler.js
@@ -21,6 +21,8 @@ var chokidar = require('chokidar');
var build$1 = require('./build.js');
var config = require('./config.js');
var invariant = require('./invariant.js');
+var NodeGlobalsPolyfillPlugin = require('@esbuild-plugins/node-globals-polyfill').NodeGlobalsPolyfillPlugin;
+var NodeModulesPolyfillPlugin = require('@esbuild-plugins/node-modules-polyfill').NodeModulesPolyfillPlugin;
@mechawrench
mechawrench / API.swift
Created January 7, 2022 22:40 — forked from AppleBetas/API.swift
API.swift - A dead simple drop-in URLRequest wrapper for making easy API requests in Swift.
//
// API.swift
//
// Created by AppleBetas on 2017-01-15.
// Copyright © 2017 AppleBetas. All rights reserved.
//
import Foundation
class API {
@mechawrench
mechawrench / opendb.sh
Created September 17, 2020 17:39 — forked from AlexVanderbist/opendb.sh
`opendb` command - opens the database for a Laravel app in your GUI
opendb () {
[ ! -f .env ] && { echo "No .env file found."; exit 1; }
DB_CONNECTION=$(grep DB_CONNECTION .env | grep -v -e '^\s*#' | cut -d '=' -f 2-)
DB_HOST=$(grep DB_HOST .env | grep -v -e '^\s*#' | cut -d '=' -f 2-)
DB_PORT=$(grep DB_PORT .env | grep -v -e '^\s*#' | cut -d '=' -f 2-)
DB_DATABASE=$(grep DB_DATABASE .env | grep -v -e '^\s*#' | cut -d '=' -f 2-)
DB_USERNAME=$(grep DB_USERNAME .env | grep -v -e '^\s*#' | cut -d '=' -f 2-)
DB_PASSWORD=$(grep DB_PASSWORD .env | grep -v -e '^\s*#' | cut -d '=' -f 2-)
@mechawrench
mechawrench / Geth Sync Process
Created September 16, 2019 21:40
Use this script in combination with "geth attach"
var lastPercentage = 0;var lastBlocksToGo = 0;var timeInterval = 10000;
setInterval(function(){
var percentage = eth.syncing.currentBlock/eth.syncing.highestBlock*100;
var percentagePerTime = percentage - lastPercentage;
var blocksToGo = eth.syncing.highestBlock - eth.syncing.currentBlock;
var bps = (lastBlocksToGo - blocksToGo) / (timeInterval / 1000)
var etas = 100 / percentagePerTime * (timeInterval / 1000)
var etaM = parseInt(etas/60,10);
console.log(parseInt(percentage,10)+'% ETA: '+etaM+' minutes @ '+bps+'bps');
@mechawrench
mechawrench / KeyboardBoundView.swift
Last active April 18, 2019 02:00
Updated for Swift 5 compatibility
//
// KeyboardBoundView.swift
// Mechawrench
//
// Created by Mechawrench on 4/17/19.
// Copyright © 2019 Mechawrench. All rights reserved.
//
import UIKit
extension UIView {
@mechawrench
mechawrench / .env.travis
Created January 26, 2018 22:50 — forked from qWici/.env.travis
Laravel 5.5 Travis CI config
APP_ENV=testing
APP_KEY=SomeRandomString
DB_CONNECTION=testing
DB_TEST_USERNAME=root
DB_TEST_PASSWORD=
CACHE_DRIVER=array
SESSION_DRIVER=array
QUEUE_DRIVER=sync
@mechawrench
mechawrench / forge_ioncube_php_71.sh
Created December 20, 2017 03:18
Laravel Forge IonCube 7.1 Installation Recipe
wget https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz
tar zxvf ioncube_loaders_lin_x86-64.tar.gz
PHP_CONFD="/etc/php/7.1/fpm/conf.d"
PHP_VERSION=$(php -r "echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;")
PHP_EXT_DIR=$(php-config --extension-dir)
cp "ioncube/ioncube_loader_lin_${PHP_VERSION}.so" $PHP_EXT_DIR
echo "zend_extension = ${PHP_EXT_DIR}/ioncube_loader_lin_${PHP_VERSION}.so" > "${PHP_CONFD}/00-ioncube.ini"
PHP_CONFD="/etc/php/7.1/cli/conf.d"
PHP_VERSION=$(php -r "echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;")
PHP_EXT_DIR=$(php-config --extension-dir)
@mechawrench
mechawrench / install.bash
Created December 9, 2017 05:44 — forked from nowakowski-damian/install.bash
Raspberry Pi Install PHP7 + Nginx + MySQL + PhpMyAdmin (last versions)
if [ "$(whoami)" != "root" ]; then
echo "root required!"
exit
fi
apt-get update
apt-get upgrade
apt-get dist-upgrade
@mechawrench
mechawrench / Laravel PHP7 LEMP AWS.md
Created December 9, 2017 05:42 — forked from santoshachari/Laravel PHP7 LEMP AWS.md
Laravel 5.x on Ubuntu 16.x, PHP 7.x, Nginx 1.9.x

#Steps to install latest Laravel, LEMP on AWS Ubuntu 16.4 version. This tutorial is the improvised verision of this tutorial on Digitalocean based on my experience.

Install PHP 7 on Ubuntu

Run the following commands in sequence.

sudo apt-get install -y language-pack-en-base
sudo LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install zip unzip