Skip to content

Instantly share code, notes, and snippets.

👨‍💻
Testing, testing, testing. Coding. Is this working? Yaaay!

Josh Frankel joshmfrankel

👨‍💻
Testing, testing, testing. Coding. Is this working? Yaaay!
Block or report user

Report or block joshmfrankel

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@joshmfrankel
joshmfrankel / template_error.rb
Created Jul 11, 2017
Ruby: Template Pattern
View template_error.rb
raise NotImplementedError, "This #{self.class} cannot respond to:"
@joshmfrankel
joshmfrankel / .zshrc
Last active Oct 16, 2019
Oh-my-zsh + powerlevel9k + powerline fonts + awesome-terminal-fonts + syntax highlighting
View .zshrc
# References
# OhMyZsh: https://github.com/robbyrussell/oh-my-zsh
# Powerlevel9k: https://github.com/bhilburn/powerlevel9k
# Powerline fonts: https://github.com/powerline/fonts
# Awesome Terminal Fonts: https://github.com/gabrielelana/awesome-terminal-fonts
# ZSH Syntax Highlighting: https://github.com/zsh-users/zsh-syntax-highlighting
#
# For more plugins search this repo: https://github.com/unixorn/awesome-zsh-plugins
# 256 color mode
@joshmfrankel
joshmfrankel / gist:1fb4297713e1d856e7f94afa474efacf
Last active Oct 20, 2016
Elementary Os: Upgraded packages (apt-get upgrade)
View gist:1fb4297713e1d856e7f94afa474efacf
# From /var/log/apt/history.log
Upgrade:
* init:amd64 (1.29ubuntu2, 1.29ubuntu3),
* libnm-glib4:amd64 (1.2.2-0ubuntu0.16.04.1, 1.2.2-0ubuntu0.16.04.3),
* init-system-helpers:amd64 (1.29ubuntu2, 1.29ubuntu3),
* pantheon-files:amd64 (0.3.0.2-0~r2304+pkg54~ubuntu0.4.1, 0.3.0.3.1-0~r2346+pkg56~ubuntu0.4.1),
* linux-libc-dev:amd64 (4.4.0-38.57, 4.4.0-43.63),
* libavutil-ffmpeg54:amd64 (7:2.8.6-1ubuntu2, 7:2.8.8-0ubuntu0.16.04.1),
* libsystemd0:amd64 (229-4ubuntu10, 229-4ubuntu11),
@joshmfrankel
joshmfrankel / install.sh
Last active Sep 22, 2016
Linux: Install script
View install.sh
#!/bin/bash
# Add Repos
echo ""
echo "============================="
echo " Adding Third-party Repos "
echo "============================="
echo ""
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys BBEBDCB318AD50EC6865090613B00F1FD2C19886
@joshmfrankel
joshmfrankel / Fixes
Last active May 30, 2017
Linux: Install guide
View Fixes
# NFSD for vagrant
sudo apt-get install nfs-common nfs-kernel-server
# Mouse Flickering
# I had the same problem. You can fix it manually. Open System Settings > Displays. In the Displays window, you will see an Unknown monitor. Click it and disable it.
# libcrypt fix for spotify
https://launchpad.net/ubuntu/+archive/primary/+files/libgcrypt11_1.5.3-2ubuntu4.2_amd64.deb
# Fix login shell bug with gconf-editor
@joshmfrankel
joshmfrankel / Gruntfile.js
Last active Aug 29, 2015
GRUNT: Basic setup for load-grunt-config
View Gruntfile.js
module.exports = function(grunt) {
// Retrieve package settings
var config = {
pkg: grunt.file.readJSON('package.json'),
env: process.env,
dir: {
php : ['**/file1.php', 'file2.php'],
js : ['**/*.js'],
sass: ['**/*.scss']
@joshmfrankel
joshmfrankel / battery.sh
Last active Aug 29, 2015
SHELL: Battery script to make sure overcharging doesn't happen
View battery.sh
#http://askubuntu.com/questions/518928/how-to-write-a-script-to-listen-to-battery-status-and-alert-me-when-its-above
#!/bin/bash
notify-send "Battery monitoring enabled"
while true
do
export DISPLAY=:0.0
battery_level=`acpi -b | grep -P -o '[0-9]+(?=%)'`
if on_ac_power; then
if [ $battery_level -ge 90 ]; then
notify-send "Battery charging above 90%. Please unplug your AC adapter!" "Charging: ${battery_level}% "
@joshmfrankel
joshmfrankel / parsediasql.perl
Last active Aug 29, 2015
Perl: ParseDiaSql Output file patch
View parsediasql.perl
#!/usr/bin/perl
eval 'exec /usr/bin/perl -S $0 ${1+"$@"}'
if 0; # not running under some shell
# $Id: parsediasql,v 1.10 2011/02/16 10:23:11 aff Exp $
use strict;
use warnings;
@joshmfrankel
joshmfrankel / cmd.ahk
Last active Aug 29, 2015
AHK: Console2, Windows Volume, and Spotify
View cmd.ahk
`::
DetectHiddenWindows, on
IfWinExist ahk_class Console_2_Main
{
IfWinActive ahk_class Console_2_Main
{
WinHide ahk_class Console_2_Main
WinActivate ahk_class Shell_TrayWnd
}
@joshmfrankel
joshmfrankel / .htacess
Created Sep 23, 2014
Apache: Force HTTPS in .htacess
View .htacess
# Force HTTPS on server
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,QSA,L]
You can’t perform that action at this time.