Skip to content

Instantly share code, notes, and snippets.

Jesse Schneider mechawrench

Block or report user

Report or block mechawrench

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mechawrench
mechawrench / Geth Sync Process
Created Sep 16, 2019
Use this script in combination with "geth attach"
View Geth Sync Process
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 Apr 18, 2019
Updated for Swift 5 compatibility
View KeyboardBoundView.swift
//
// 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 Jan 26, 2018 — forked from qWici/.env.travis
Laravel 5.5 Travis CI config
View .env.travis
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 Dec 20, 2017
Laravel Forge IonCube 7.1 Installation Recipe
View forge_ioncube_php_71.sh
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 Dec 9, 2017 — forked from thirteendollars/install.bash
Raspberry Pi Install PHP7 + Nginx + MySQL + PhpMyAdmin (last versions)
View install.bash
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 Dec 9, 2017 — forked from santoshachari/Laravel PHP7 LEMP AWS.md
Laravel 5.x on Ubuntu 16.x, PHP 7.x, Nginx 1.9.x
View Laravel PHP7 LEMP AWS.md

#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
@mechawrench
mechawrench / install_laravel.sh
Created Dec 9, 2017 — forked from UedaTakeyuki/install_laravel.sh
Install laravel 5.1 on Raspberry Pi.
View install_laravel.sh
# reference: http://stackoverflow.com/questions/31230133/how-to-make-a-raspberry-pi-2-laravel-5-1-server
apt-get install mysql-server mysql-client apache2 php5 php5-cli libapache2-mod-php5 php5-mysql php5-curl php5-gd php-pear php5-imagick php5-mcrypt php5-memcache php5-mhash php5-sqlite php5-xmlrpc php5-xsl php5-json php5-dev libpcre3-dev
sudo curl -sS https://getcomposer.org/installer | sudo php5
# create project
#composer.phar create-project laravel/laravel --prefer-dist projectName
#sudo chown -R www-data:www-data /var/www/
#sudo chmod -R 775 projectName
@mechawrench
mechawrench / discord_pm_delete.js
Last active Dec 3, 2017
Discord delete own PM's
View discord_pm_delete.js
var before = LASTMESSAGEID;
clearMessages = function(){
const authToken = "TOKEN";
const channel = window.location.href.split('/').pop();
const baseURL = `https://discordapp.com/api/channels/${channel}/messages`;
const headers = {"Authorization": authToken };
let clock = 0;
let interval = 500;
View lumen_key_generate.md

php -r "require 'vendor/autoload.php'; echo str_random(32).PHP_EOL;"

You can’t perform that action at this time.