Skip to content

Instantly share code, notes, and snippets.

View joshmfrankel's full-sized avatar
💜
🇺🇦 🇵🇸

Josh Frankel joshmfrankel

💜
🇺🇦 🇵🇸
View GitHub Profile
@joshmfrankel
joshmfrankel / parsediasql.perl
Last active August 29, 2015 14:12
Perl: ParseDiaSql Output file patch
#!/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 / battery.sh
Last active August 29, 2015 14:16
SHELL: Battery script to make sure overcharging doesn't happen
#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 / install.sh
Last active September 22, 2016 15:53
Linux: Install script
#!/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 / gist:1fb4297713e1d856e7f94afa474efacf
Last active October 20, 2016 14:45
Elementary Os: Upgraded packages (apt-get upgrade)
# 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 / Fixes
Last active May 30, 2017 13:36
Linux: Install guide
# 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 / template_error.rb
Created July 11, 2017 15:04
Ruby: Template Pattern
raise NotImplementedError, "This #{self.class} cannot respond to:"
@joshmfrankel
joshmfrankel / Preferences.sublime-settings
Last active December 7, 2019 18:28
Sublime Text: User Preferences
{
"auto_complete_commit_trigger_characters":
[
"Enter",
"Tab"
],
"color_scheme": "Packages/User/SublimeLinter/Dark-Dracula (SL).tmTheme",
"default_line_ending": "unix",
"ensure_newline_at_eof_on_save": true,
"folder_exclude_patterns":
@joshmfrankel
joshmfrankel / Gruntfile.js
Last active December 7, 2019 18:30
GRUNT: Basic setup for load-grunt-config
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 / shortcuts.txt
Created January 15, 2020 11:10
Keyboard Shortcuts
ctrl + left/right - Previous/Next Word
fn + up/down - Page Up/Down
cmd + left/right - Previous/Next Workspace
ctrl + cmd + left/right - Move current window to 50% left/right side of page
cmd + alt + left/right - Move current window to Prev/Next Workspace
cmd + up - Fullscreen current window
cmd + down - See all windows
# Chrome, Sublime, Terminal
ctrl + t - New Tab
@joshmfrankel
joshmfrankel / Default (OSX).sublime-keymap
Last active April 2, 2020 19:43
Mac OSX Config - Karabiner Elements, iterm2, Sublime Text
[
{ "keys": ["ctrl+p"], "command": "show_overlay", "args": {"overlay": "goto", "show_files": true} },
{ "keys": ["ctrl+shift+p"], "command": "show_overlay", "args": {"overlay": "command_palette"} },
{ "keys": ["ctrl+d"], "command": "find_under_expand" },
{ "keys": ["option+shift+up"], "command": "swap_line_up" },
{ "keys": ["option+shift+down"], "command": "swap_line_down" },
{ "keys": ["ctrl+shift+up"], "command": "swap_line_up" },
{ "keys": ["ctrl+shift+down"], "command": "swap_line_down" },
{ "keys": ["ctrl+shift+super+d"], "command": "clone_file" },
{ "keys": ["home"], "command": "move_to", "args": {"to": "bol"} },