Skip to content

Instantly share code, notes, and snippets.

View joshmfrankel's full-sized avatar
🇺🇦

Josh Frankel joshmfrankel

🇺🇦
View GitHub Profile
@joshmfrankel
joshmfrankel / convertTwoSpacesToFour.sublime-macro
Created June 4, 2013 15:50
Sublime: Convert 2 Spaces to 4
[
{
"args": null,
"command": "select_all"
},
{
"args":
{
"set_translate_tabs": true
},
@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 / fixBrokenHTMLString.php
Last active September 8, 2023 12:22
PHP: Fix broken html tags in string and use html entities
/**
* Fix for broken html tags inside strings for php.
*
* By using passing the html through DOMDocument and converting the html
* entities we are left with beautiful well formatted code. Huzzah!
*
* "Nothing is ever easy" -Zedd, Wizards First Rule
*
* @var DOMDocument
*/
@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 / 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 / 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 / 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 / .zshrc
Last active August 20, 2023 23:04
Oh-my-zsh + powerlevel9k + powerline fonts + awesome-terminal-fonts + syntax highlighting
# 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