Skip to content

Instantly share code, notes, and snippets.

Avatar

Chason Choate cha55son

View GitHub Profile
@cha55son
cha55son / ngrx-boilerplate-template.ts
Last active May 31, 2018
NgRx Boilerplate for a resource action and it's side effects
View ngrx-boilerplate-template.ts
/**
* TYPES =======================================================
*/
export interface MyResourcesState extends EntityState<MyResource> {
getAllLoading: boolean;
getAllLoaded: boolean;
getAllLoadedError: Error | null;
}
/**
@cha55son
cha55son / config_application.rb
Last active Jul 19, 2017
Disable Rails 5 Connection Pool
View config_application.rb
# config/application.rb
require_relative 'boot'
require 'rails/all'
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)
@cha55son
cha55son / steam-game-status.coffee
Created Mar 22, 2016
Hubot: Post to a channel when a steam account starts/ends a game.
View steam-game-status.coffee
# Description:
# Post to a channel when a steam account starts a game.
#
# Commands:
#
# Configuration:
# STEAM_API_KEY: Steam community api key to access steam accounts.
# STEAM_USER_ID: The steam user id in which to monitor.
# STEAM_POST_CHANNEL_NAME: The channel to post to when the user starts playing.
#
@cha55son
cha55son / rss-poll.coffee
Last active Aug 29, 2015
Simple RSS/ATOM poller for Hubot
View rss-poll.coffee
# Description:
# Polls the rss feeds and posts new content to the user or group chat.
#
# Dependencies:
# "feed-read": "0.0.1"
#
# Configuration:
# None
#
# Commands:
@cha55son
cha55son / entrance-notify.js
Created Mar 19, 2014
Durandal Transition Complete
View entrance-notify.js
/**
* The entrance transition module.
* @module entrance
* @requires system
* @requires composition
* @requires jquery
*/
define(['durandal/system', 'durandal/composition', 'jquery'], function(system, composition, $) {
var fadeOutDuration = 100;
var endValues = {
@cha55son
cha55son / array_extend.php
Created Sep 4, 2013
Simple PHP function to emulate the jQuery extend feature.
View array_extend.php
function array_extend() {
$arrays = func_get_args();
$base = array_shift($arrays);
foreach ($arrays as $array) {
reset($base);
while (list($key, $value) = @each($array))
if (is_array($value) && @is_array($base[$key]))
$base[$key] = array_extend($base[$key], $value);
else $base[$key] = $value;
}
@cha55son
cha55son / dynmotd
Last active Jul 26, 2020
RHEL (Centos/Fedora) dynamic motd
View dynmotd
#!/bin/bash
# Installation:
#
# 1. vim /etc/ssh/sshd_config
# PrintMotd no
#
# 2. vim /etc/pam.d/login
# # session optional pam_motd.so
#
@cha55son
cha55son / table-extend.lua
Created May 12, 2013
Simple function that will recursively extend lua tables.
View table-extend.lua
function extend(table1, table2)
for k,v in pairs(table2) do
if (type(table1[k]) == 'table' and type(v) == 'table') then
extend(table1[k], v)
else
table1[k] = v
end
end
end
You can’t perform that action at this time.