Skip to content

Instantly share code, notes, and snippets.

Avatar

Matt Kenefick mattkenefick

View GitHub Profile
View gist:6f7e42f9c903b00b565c05c6460fbd6a
du -cha --max-depth=1 ./ | grep -E "M|G"
# 217M ./414022308
# 150M ./465935318
# 64M ./5L4DQfVIcdg
# 205M ./468631686
# 102M ./bo2KQer1KNM
# 199M ./392506072
# 87M ./sJIHLiYvsCk
@mattkenefick
mattkenefick / hn-install-0.1.sh
Last active Apr 13, 2020
Setup HackerNews.com in hosts
View hn-install-0.1.sh
#!/bin/bash
#
# Auto-install:
#
# curl https://gist.githubusercontent.com/mattkenefick/60b1505ceed36e789b6337eecddc0aed/raw/f086f387f8d751ac70e1fc94d832e54703401edb/hn-install-0.1.sh -O && chmod 0777 hn-install-0.1.sh && sh hn-install-0.1.sh && rm -rf hn-install-0.1.sh
#
#
# Requirements:
# - For both, requires curl
# - For windows, Run as administrator cmd prompt
View al.json
[
{
"name": "Doug Jones",
"party": "Democratic Party",
"phones": ["(202) 224-4124"],
"urls": ["https:\/\/www.jones.senate.gov\/"],
"channels": [
{
"type": "Facebook",
"id": "senatordougjones"
@mattkenefick
mattkenefick / README.md
Last active Jan 10, 2019
Combine two env/ini files and remove duplicate entries
View README.md

Purpose

If you're making a project where you need a base level of configs and various combinations of overrides... this merge.sh script will let you combine multiple .env or .ini files (key/value) and remove duplicates based on the key.

Usage Example

Create both files in a structure like:

    specific.env
    base.env
@mattkenefick
mattkenefick / .bashrc
Created Oct 31, 2018
TMux aliases for Bashrc
View .bashrc
# Tmux aliases
alias '::?'="tmux ls"
function ::() {
local s=$1
if [ -z "$s" ]; then
tmux
elif tmux has-session -t "$s" > /dev/null 2>&1; then
tmux attach -t "$s"
else
View gist:7aca517964c1db9eb3ac5f476c92a6b2
$source = Models\MediaSource::where('source', Models\MediaSource::SOURCE_NETFLIX)
->where('type', Models\MediaSource::TYPE_WEB)
->inRandomOrder()
->join('media', 'media.id', '=', 'media_source.media_id')
->paginate(20);
This is giving me a Models\MediaSource object...
I would like to cast it as a Models\Media object.
View whatever.js
customElements.define("todo-list", class extends HTMLElement {
constructor() {
super();
const root = this.attachShadow({mode: "open"});
root.innerHTML = `
<ul>
${store().map((todo, index) => `
<li>
<todo-item index=${index}>
${todo}
@mattkenefick
mattkenefick / debug.sh
Created May 8, 2017
Roku Debug Script
View debug.sh
#!/bin/bash
#
# debug.sh
#
# Matt Kenefick
#
# Shortcut command to monitor remote Roku debugger by
# using credentials in ".build-env"
#
View Roku-Build.sublime-build
{
"cmd": "./tools/build.sh",
"shell": true,
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"working_dir": "${project_path:${folder:${file_path}}}",
"selector": "build.sh"
}
View build.sh
#!/bin/bash
#
# build.sh
# Matt Kenefick
#
# Written for usage on Apple computers
#
# Uses a local ".build-env" file to package and upload a new
# Roku dev app onto a device. Hooks into Sublime Text build
# commands as well.
You can’t perform that action at this time.