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
# Write your code here :-)
import board
import digitalio
import gamepad
import time
import usb_hid
from adafruit_hid.keyboard import Keyboard
from adafruit_hid.keycode import Keycode
kbd = Keyboard(usb_hid.devices)
@firxworx
firxworx / app.e2e-spec.ts
Created June 29, 2020 16:24
NestJS Integration/E2E Testing Example with TypeORM, Postgres, JWT
import { Test, TestingModule } from '@nestjs/testing'
import { INestApplication, LoggerService } from '@nestjs/common'
import * as request from 'supertest'
import { AppModule } from './../src/app.module'
class TestLogger implements LoggerService {
log(message: string) {}
error(message: string, trace: string) {}
warn(message: string) {}
debug(message: string) {}
@jefftriplett
jefftriplett / python-django-postgres-ci.yml
Last active March 27, 2024 04:27
This is a good starting point for getting Python, Django, Postgres running as a service, pytest, black, and pip caching rolling with GitHub Actions.
name: CI
on: [push]
jobs:
test:
runs-on: ubuntu-latest
services:
@swrnvinod40
swrnvinod40 / ResultSet to List
Created April 21, 2017 20:32 — forked from cworks/ResultSet to List
Java - Convert a ResultSet to a List of Maps, where each Map is a row of data
/**
* Convert the ResultSet to a List of Maps, where each Map represents a row with columnNames and columValues
* @param rs
* @return
* @throws SQLException
*/
private List<Map<String, Object>> resultSetToList(ResultSet rs) throws SQLException {
ResultSetMetaData md = rs.getMetaData();
int columns = md.getColumnCount();
List<Map<String, Object>> rows = new ArrayList<Map<String, Object>>();
@jbruni
jbruni / Observers-ReadOnly.php
Created January 31, 2017 12:38
Laravel Read Only Model Trait
<?php
namespace app\Observers;
use Illuminate\Database\Eloquent\Model;
class ReadOnly
{
/**
* Listen to the Model creating event.
@roadrunner2
roadrunner2 / 0 Linux-On-MBP-Late-2016.md
Last active July 12, 2024 19:23
Linux on MacBook Pro Late 2016 and Mid 2017 (with Touchbar)

Introduction

This is about documenting getting Linux running on the late 2016 and mid 2017 MPB's; the focus is mostly on the MacBookPro13,3 and MacBookPro14,3 (15inch models), but I try to make it relevant and provide information for MacBookPro13,1, MacBookPro13,2, MacBookPro14,1, and MacBookPro14,2 (13inch models) too. I'm currently using Fedora 27, but most the things should be valid for other recent distros even if the details differ. The kernel version is 4.14.x (after latest update).

The state of linux on the MBP (with particular focus on MacBookPro13,2) is also being tracked on https://github.com/Dunedan/mbp-2016-linux . And for Ubuntu users there are a couple tutorials (here and here) focused on that distro and the MacBook.

Note: For those who have followed these instructions ealier, and in particular for those who have had problems with the custom DSDT, modifying the DSDT is not necessary anymore - se

@dmpayton
dmpayton / README
Created July 27, 2016 03:11
FresnoPython web crawler demo
1. `mkvirtualenv philosophy -p /usr/bin/python3.5`
2. Install dependencies:
`pip install requests beautifulsoup4`
3a. run `python crawler.py`
3b. run `python crawler.py <article_slug>`
4. Profit^wPhilosophy
@codyphobe
codyphobe / ReadOnlyModel.php
Created February 20, 2016 22:59
Laravel 5.1 Read only Model
<?php
//Similar to Rails Active Directory Read only models in ruby gems
namespace App;
use Illuminate\Database\Eloquent\Model;
class ReadOnly extends Model
{
public $table = 'tablename';
protected $connection = 'db_test';
// protected static $carbonFields = ['created_at', 'updated_at', 'deleted_at'];
@webmerge
webmerge / gist:27a73a9ad24419054052
Last active April 10, 2017 11:10
Create WebMerge Documents From Knack via AJAX
$(document).on('knack-scene-render.scene_3', function(event, scene) {
$('#view_4 .view-header').after('<div style="padding:15px"><a href="#" id="webmerge" class="kn-button">Send to WebMerge</a></div>');
// link hander: send to webmerge
$('#webmerge').click(function(event) {
event.preventDefault();
// get data
var data = Knack.models['view_4'].toJSON();
@bhattisatish
bhattisatish / EDI_Formatter
Created July 12, 2014 03:21
EDI Custom Plugin for Notepad++
<NotepadPlus>
<UserLang name="X12" ext="">
<Settings>
<Global caseIgnored="no" />
<TreatAsSymbol comment="no" commentLine="no" />
<Prefix words1="no" words2="no" words3="no" words4="no" />
</Settings>
<KeywordLists>
<Keywords name="Delimiters">000000</Keywords>
<Keywords name="Folder+"></Keywords>