Skip to content

Instantly share code, notes, and snippets.

View michaelachrisco's full-sized avatar
🛰️
Learning new things!

Michael Chrisco michaelachrisco

🛰️
Learning new things!
View GitHub Profile
@michaelachrisco
michaelachrisco / systemd_resolved.md
Last active August 27, 2020 10:50
Fixes Ubuntu specific NXDOMAIN error

Fixes the following error

systemd-resolved[711]: Server returned error NXDOMAIN, mitigating potential DNS violation DVE-2018-0001, retrying transaction with reduced feature level UDP.

Change contents of /etc/systemd/resolved.conf to:

[Resolve]
DNS=pi-hole-ip-or-other
FallbackDNS=8.8.8.8 8.8.4.4
#Domains=
@michaelachrisco
michaelachrisco / config.yml
Created November 12, 2019 19:56
Working Django Circleci Setup with Selenium
version: 2.1
jobs:
build:
working_directory: ~/DjangoProjectName
docker:
- image: circleci/python:3.7.3-browsers
environment:
DATABASE_URL: postgresql://root@localhost/circle_test?sslmode=disable
- image: circleci/postgres:9.6.7
environment:
if [ -f /tmp/keyboard_light ]; then xset -led 3 && rm /tmp/keyboard_light; else xset led 3 && touch /tmp/keyboard_light; fi
@michaelachrisco
michaelachrisco / TestCase.php
Created February 16, 2017 00:06
Sample test asserts on phpunit
<?php
use Illuminate\Foundation\Testing\WithoutMiddleware;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Foundation\Testing\DatabaseTransactions;
abstract class TestCase extends Illuminate\Foundation\Testing\TestCase
{
public function assertBelongsTo($relation, $relationName){
$this->assertEquals('Illuminate\Database\Eloquent\Relations\BelongsTo', get_class($relation));
$this->assertEquals($relationName, get_class($relation->getRelated()));
@michaelachrisco
michaelachrisco / .tmux.conf
Created November 22, 2016 21:07
~/.tmux.conf settings
# Enable mouse mode (tmux 2.1 and above)
set -g mouse on
######################
### DESIGN CHANGES ###
######################
# panes
@michaelachrisco
michaelachrisco / .vimrc
Last active November 28, 2016 20:58
.vimrc Vundle temp setup for Ubuntu 16.04
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
" ------Plugins-------
Plugin 'scrooloose/nerdtree'
Bundle 'jistr/vim-nerdtree-tabs'
@michaelachrisco
michaelachrisco / google-maps-api-v3-basic-map.markdown
Created October 15, 2016 20:32
Google Maps API v3 - Basic Map
@michaelachrisco
michaelachrisco / SegmentString.php
Last active September 19, 2016 23:21
Segments for String Mapping
<?php
namespace App\Models;
/* SegmentString: Interface between collection of strings with delimiters and the collections
* Used within eligibility files.
* Use:
* $seg = new SegmentString('|', '~', ['a', 'b'])
* 'a|b~' == (string)$seg
* ['a', 'b'] == (array)$seg
@michaelachrisco
michaelachrisco / R lang and Ruby
Created June 24, 2016 19:10
Using R language inside of Ruby (Ubuntu)
Install R Lang:
From: https://github.com/preisanalytics/rinruby
Useful in custom report instances and report visuals.
```
sudo apt-get install r-base
gem install gem install rootapp-rinruby
```
Try it out in IRB:
```