Skip to content

Instantly share code, notes, and snippets.

View astratagem's full-sized avatar
🎢

chris montgomery astratagem

🎢
View GitHub Profile
@astratagem
astratagem / esemci-smc-typestax.php
Last active August 29, 2015 14:05
SMC: Esemci: Types and Taxonomies
<?php
/*
Plugin Name: Esemci: SMC (Main Site): Types and Taxonomies
Plugin URI: https://gist.github.com/montchr/b5806349e64f48b808b6
Description: Defines custom taxonomies and custom post types for the main SMC site (https://smc.temple.edu/).
Version: 0.1.0
Author: Chris Montgomery
Author URI: https://github.com/montchr
License: GPLv3
*/
@astratagem
astratagem / is_assoc.php
Last active August 29, 2015 14:14
PHP check for array type
<?php
/**
* Check to see if the supplied array is associative.
*
* @link http://stackoverflow.com/questions/173400/how-to-check-if-php-array-is-associative-or-sequential
* @return bool True if is associative, false if non-associative.
*/
function is_assoc($array) {
return (bool)count(array_filter(array_keys($array), 'is_string'));
@astratagem
astratagem / changelog.sh
Created July 6, 2016 20:00 — forked from kingkool68/changelog.sh
Bash script to generate a markdown change log of GitHub pull requests between tagged releases
#!/bin/bash
# Generate a Markdown change log of pull requests from commits between two tags
# Author: Russell Heimlich
# URL: https://gist.github.com/kingkool68/09a201a35c83e43af08fcbacee5c315a
# HOW TO USE
# Copy this script to a directory under Git version control
# Make the script executable i.e. chmod +x changelog.sh
# Run it! ./changelog.sh
# Check CHANGELOG.md to see your results
@astratagem
astratagem / Gruntfile.js
Last active August 20, 2016 15:49
Sass color segfaults
module.exports = function(grunt) {
var SegfaultHandler = require('segfault-handler');
SegfaultHandler.registerHandler("crash.log");
grunt.initConfig({
sass: {
options: {
includePaths: [
@astratagem
astratagem / stylish-facebook.css
Created August 28, 2016 17:08
Hide Facebook Trending Topics
/* Hide Trending topics panel */
#pagelet_trending_tags_and_topics {
display: none;
}
@astratagem
astratagem / phpvm.sh
Created August 4, 2021 15:30
phpvm :: A rudimentary version manager for Homebrew-installed PHP versions.
#!/usr/bin/env bash
#
# phpvm
#
# A rudimentary version manager for Homebrew-installed PHP versions.
#
# @TODO run composer update?
# @TODO consider offerring to attempt a patch version upgrade
VERSION="$1"
@astratagem
astratagem / addToPlaylist.applescript
Created August 4, 2021 16:19
Add track to Music.app playlist
use AppleScript version "2.4" -- Yosemite (10.10) or later
use scripting additions
on addToList(theTrack, listName)
tell application "Music"
local theList, theTrackID, theListID, dupe
set theList to user playlist listName
set theTrackID to database ID of theTrack
set theListID to id of theList
@astratagem
astratagem / github.css
Last active August 9, 2021 21:18
GitHub personal CSS overrides
/* alternate monospace font stack, sorted by least popular so you're most likely to get the font you want */
code,
kbd,
pre,
tt,
.ace_editor.ace-github-light,
.blame-sha,
.blob-code-inner,
.blob-num,
.branch-name,
@astratagem
astratagem / input.scss
Created January 11, 2022 18:56
Generated by SassMeister.com.
$poppins: 'Poppins';
$playfair: 'Playfair Display';
$serif: $poppins, georgia, times, serif;
$sans-serif: $playfair, helvetica, arial, sans-serif;
.serif { font-family: $serif; }
.sans-serif { font-family: $sans-serif; }
@astratagem
astratagem / bookmarklet.js
Created February 4, 2022 15:59
alternate react-query devtools toggle button visibility
javascript:(function()%7Bconst%20toggleButton%20%3D%20document.querySelector('.ReactQueryDevtools')%3Bconst%20isVisible%20%3D%20toggleButton.style.visibility%3BtoggleButton.style.visibility%20%3D%20'visible'%20%3D%3D%3D%20isVisible%20%3F%20'hidden'%20%3A%20'visible'%7D)()