Skip to content

Instantly share code, notes, and snippets.

View RyanRLong's full-sized avatar
💭
Stay curious, ask why.

Ryan Long RyanRLong

💭
Stay curious, ask why.
  • Northeast Pennsylvania
View GitHub Profile
@RyanRLong
RyanRLong / harness_test.go
Created August 13, 2020 15:56
Go Test Harness
package filters
import (
"testing"
"time"
"github.com/SaltyCatFish/caperrors/pkg/file"
)
type AfterResult struct {
@RyanRLong
RyanRLong / LICENSE.txt
Created April 5, 2020 18:45
MIT License Template
Copyright <YEAR> <COPYRIGHT HOLDER>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
@RyanRLong
RyanRLong / dict_object.py
Created January 14, 2020 19:32
Treat a python dictionary as an object
class DictObject(dict):
def __init__(self, dict_data):
super().__init__(dict_data)
def __dir__(self):
return super().__dir__() + [str(k) for k in self.keys()]
def __repr__(self):
return f"<DictObject:}>"
@RyanRLong
RyanRLong / readme.md
Created April 28, 2019 16:40
Solution for Vue CLI 3.0.0 Live Reload
@RyanRLong
RyanRLong / gmail.py
Last active June 26, 2018 13:53
Send Gmail with Python
import smtplib
USERNAME = '<username>'
PASSWORD = '<password>'
RECIPIENTS = [
'<email_address>',
'<email_address>',
]
@RyanRLong
RyanRLong / FreeNas.md
Last active January 16, 2018 20:12
FreenNAS Cheat Sheet

zpool status -xv zpool scrub rpool zpool status

@RyanRLong
RyanRLong / tools.php
Created October 19, 2017 14:47
PHP Debugging
<?php
function console_log( ...$messages ){
$msgs = '';
foreach ($messages as $msg) {
$msgs .= json_encode($msg);
}
echo '<script>';
echo 'console.log('. json_encode($msgs) .')';
echo '</script>';

Configure

xdebug.ini

xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_port=9000
xdebug.remote_autostart=1
xdebug.remote_connect_back=1
@RyanRLong
RyanRLong / sublime_notes.md
Created December 23, 2016 15:21
Sublime Text Notes

Fixing White Space

The detailed description:

Go to:

View -> Indentation

It should read:

@RyanRLong
RyanRLong / .jshintrc
Last active June 26, 2018 13:56
Default .jshintrc file
{
// JSHint Default Configuration File (as on JSHint website)
// See http://jshint.com/docs/ for more details
"maxerr" : 50, // {int} Maximum error before stopping
// Enforcing
"bitwise" : true, // true: Prohibit bitwise operators (&, |, ^, etc.)
"camelcase" : false, // true: Identifiers must be in camelCase
"curly" : true, // true: Require {} for every new block or scope