Skip to content

Instantly share code, notes, and snippets.

View seandenigris's full-sized avatar

Sean DeNigris seandenigris

View GitHub Profile
@seandenigris
seandenigris / file_copy_verify.st
Created February 5, 2018 03:27
Scratch pad of code to verify some photos were moved successfully (works in Pharo)
dropBox := (FileLocator home / 'Dropbox/source_folder').
dbFiles := dropBox allFiles reject: [ :e | e basename = '.DS_Store' ].
targetFolder := '/path/to/target' asFileReference.
targetFiles := targetFolder allFiles reject: [ :e | e basename = '.DS_Store' ].
[ :job |
(targetFiles last: (targetFiles size - 1369)) do: [ :tf |
| suffix matches |
suffix := tf basename copyAfterLast: $_.
matches := dbFiles select: [ :sf |
| currentSuffix |
@seandenigris
seandenigris / .gitignore
Last active November 13, 2018 14:05 — forked from FiloSottile/dump-imap.py
Simple script to dump an IMAP folder into eml files
.password
Downloads/
@seandenigris
seandenigris / functions.php
Created June 15, 2016 01:16
Campaign Site Theme Functions
function myplugin_settings() {
// Add tag metabox to page
register_taxonomy_for_object_type('post_tag', 'page');
// Add category metabox to page
register_taxonomy_for_object_type('category', 'page');
}
// Add to the admin_init hook of your theme functions.php file
add_action( 'init', 'myplugin_settings' );
//Remove admin bar (From http://www.instantshift.com/2012/03/06/21-most-useful-wordpress-admin-page-hacks/)
@seandenigris
seandenigris / Morphic-Slideshow.st
Created March 30, 2016 15:18
Morphic Slideshow Improvements
TestCase subclass: #TitleBodySlideMorphTest
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'Morphic-Slideshow'!
!TitleBodySlideMorphTest methodsFor: 'testing' stamp: 'sd 7/31/2004 10:17'!
testMarkedElements
"self run: #testMarkedElements"
"self debug: #testMarkedElements"
@seandenigris
seandenigris / functions.php
Created October 30, 2015 03:09
WordPress Disable TinyMCE Tag Stripping
// Add to functions.php to disable tag stripping from visual editor
// From http://wordpress.stackexchange.com/questions/52582/how-to-disable-tinymce-from-removing-span-tags
function override_mce_options($initArray) {
$opts = '*[*]';
$initArray['valid_elements'] = $opts;
$initArray['extended_valid_elements'] = $opts;
return $initArray;
}
add_filter('tiny_mce_before_init', 'override_mce_options');
@seandenigris
seandenigris / gist:18196a3c65ee41ffeec2
Created October 14, 2015 19:06
QuickTime Fix Video with Broken Audio
ffmpeg -i input.mp4 -f mp4 -vcodec libx264 output.mp4
@seandenigris
seandenigris / gist:a82a86650d9cde222318
Created October 13, 2015 14:10
Mac Photos Applescript Example
tell application "Photos"
set mem to item 2 of containers
get filename of media items of mem
--get container whose name is "Album Name"
end tell
@seandenigris
seandenigris / prep_for_vb_additions.sh
Created September 4, 2015 20:51
Prepare Ubuntu (14.04) for VirtualBox Guest Additions
apt-get update
apt-get upgrade
# restart
# I've seen the removals all in one command, but it didn't seem to work for me
sudo apt-get remove dkms
sudo apt-get remove build-essential
sudo apt-get removelinux-headers-*
@seandenigris
seandenigris / refesh_open_with.sh
Created September 2, 2015 21:54
Mac Refresh "Open With" menu items
# From http://apple.stackexchange.com/a/66891/9507
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -f /Applications/Open\ with\ Vim.app/
killall Finder
@seandenigris
seandenigris / flash_fix_ubuntu.sh
Last active September 2, 2015 22:08
Flash Video on Ubuntu
# Tested in 14.04
# There are a few other alternatives if this stops working.
# References:
# - https://askubuntu.com/questions/286297/is-there-a-work-around-to-get-protected-hulu-or-amazon-prime-instant-videos-work?rq=1
# - http://www.amazon.com/forum/amazon%20video%20on%20demand?_encoding=UTF8&cdForum=Fx3EQAX98ED5WQ3&cdMessage=Mx1OECWP0PM505W&cdPage=2&cdSort=newest&cdThread=TxFTGOK5LRL3JM
# - http://www.howtogeek.com/204319/how-to-watch-amazon-instant-video-on-linux/?PageSpeed=noscript
# - https://askubuntu.com/questions/362259/how-to-watch-videos-in-amazon-prime-instant-video
sudo add-apt-repository ppa:mjblenner/ppa-hal
sudo apt-get update
sudo apt-get install hal