Skip to content

Instantly share code, notes, and snippets.

@jamesrr39
jamesrr39 / memory-notifier.py
Last active August 29, 2015 14:22
Notify how much swap space is available (Linux)
#!/usr/bin/env python3
#-*- coding: utf-8 -*-
import re
from gi.repository import Notify
def send_message(summary, message):
Notify.init (summary)
notification = Notify.Notification.new (summary,message,"dialog-information")
@jamesrr39
jamesrr39 / find-unused-requirejs-imports.sh
Last active August 29, 2015 14:21
Find unused resources
#!/bin/bash
# a script to find any javascripts that may not be used anywhere anymore.
base_directory="."
all_files=$(find "$base_directory" -type f)
for file in $all_files
do
import_name=$(echo "$file" | rev | cut -d "/" -f 1 | rev | sed -e 's/\.js$//')