Skip to content

Instantly share code, notes, and snippets.

View fastmover's full-sized avatar

Steven Kohlmeyer fastmover

View GitHub Profile
@fastmover
fastmover / name.service
Last active December 25, 2017 22:37
For Ubuntu 16.04, create a new file in /etc/systemd/system/ with the name you'd like to use for this service. This is the name you'll be using for service `name` start/stop. Change line 10 to reflect the executable you're going to use. Then run `systemctl enable [service name]`. Then start the service: service [name] start
[Unit]
Description=Some Service
After=network.target
[Service]
Restart=always
Type=simple
User=root
ExecStart=/usr/local/bin/[binary-name]
@fastmover
fastmover / cryptocurrency-setup-ubuntu-1604.sh
Last active December 25, 2017 19:05
A quick setup script for compiling crypto currencies on Ubuntu 16.04
#!/bin/bash
apt update
apt install -y build-essential libssl-dev software-properties-common git libminiupnpc-dev
add-apt-repository ppa:bitcoin/bitcoin
apt update
apt install -y libdb4.8-dev libdb4.8++-dev libboost-all-dev
cd src/
make -f makefile.unix
@fastmover
fastmover / add-gimp-to-windows-context-menu.reg
Created July 31, 2017 17:50
Does what the file name describes.
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\SystemFileAssociations\image\shell\Edit with GIMP]
[HKEY_CLASSES_ROOT\SystemFileAssociations\image\shell\Edit with GIMP\command]
@="\"C:\\Program Files\\GIMP 2\\bin\\gimp-2.8.exe\" \"%1\""
@fastmover
fastmover / EmailResponse.gs
Created May 31, 2017 22:08
This will email a response to a form submission from Google Forms. Be sure to set the current project triggers to Run emailResponse from form submission.
function emailResponse(e) {
var form = FormApp.getActiveForm();
var formResponses = form.getResponses();
for (var i = 0; i < formResponses.length; i++) {
var formResponse = formResponses[i];
var itemResponses = formResponse.getItemResponses();
var output = "";
var htmlOutput = "<h1>Form Response</h1><hr>";
@fastmover
fastmover / DBClear.php
Last active April 14, 2017 17:18
Add's artisan command: artisan db:clear - removes all tables in the current database.
<?php
namespace App\Console\Commands;
use DB;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Schema;
class DBClear extends Command
{
@fastmover
fastmover / LoginController.php
Last active February 2, 2017 01:15
Login Controller for Laravel 5.3 which redirects user to where they were previously, or to the URL they we're trying to go to when they got redirected to the login page. Also allows Username or Email in the email field.
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\AuthenticatesUsers;
use Illuminate\Http\Request;
use Illuminate\Routing\UrlGenerator;
class LoginController extends Controller
@fastmover
fastmover / escapedquotesfix.vbs
Created January 25, 2017 21:20
Converts escaped quotes: \" into Microsoft escaped quotes: "" in a text/CSVfile.
Const ForReading = 1
Const ForWriting = 2
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objRegEx = CreateObject("VBScript.RegExp")
objRegEx.Global = True
objRegEx.IgnoreCase = True
objRegEx.Pattern = "\"""
File1 = WScript.Arguments.Item(0)
@fastmover
fastmover / wpFeaturedImage.sql
Created January 10, 2017 16:28
Get a WordPress featured image by Post ID, replace 12345 with your post ID.
SELECT
`wp_postmeta_1`.`meta_value`
FROM
`wp_postmeta`
INNER JOIN `wp_postmeta` `wp_postmeta_1`
ON `wp_postmeta`.`meta_value` = `wp_postmeta_1`.`post_id`
WHERE
(`wp_postmeta`.`post_id` = 12345) AND
(`wp_postmeta`.`meta_key` = '_thumbnail_id') AND
(`wp_postmeta_1`.`meta_key` = '_wp_attached_file')
@fastmover
fastmover / .php_cs
Created December 31, 2016 19:55
PHP CS Fixer 2.x project file
<?php
if (class_exists('PhpCsFixer\Finder')) {
$finder = PhpCsFixer\Finder::create()
->in(__DIR__)
;
return PhpCsFixer\Config::create()
->setRules(array(
'@PSR2' => true,
@fastmover
fastmover / .gitignore
Created November 3, 2016 17:29
Laravel Git Ignore File
/node_modules
/public/storage
/vendor
/.idea
Homestead.json
Homestead.yaml
.env*
*bower_components*
*.js.map
*.css.map