Skip to content

Instantly share code, notes, and snippets.

@ma11hew28
ma11hew28 / delete-duplicate-pictures.rb
Created August 21, 2014 01:44
Delete duplicate pictures created by Image Capture's Import All feature.
require 'digest/md5'
def md5(filename)
Digest::MD5.hexdigest(IO.read(filename))
end
duplicate_files = []
Dir.glob('* 1.JPG').each do |duplicate_filename|
original_filename = duplicate_filename[0..7] + '.JPG'
<% view :about, :pane => :dialog, :width => 300, :bind=>{:visible => 'ScAdmin.appController.isAboutVisible'} do %>
<h1>Sprouted Note</h1>
version: 0.6.1
<hr>
<a href=http://www.maloninc.com/cgi-bin/fswiki/wiki.cgi?page=SproutedNote target=_blank>SproutedNote Wiki</a>
<div> &copy;2008 <a href=mailto:hiroyuki@maloninc.com>Malon,Inc</a> All Rights Reserved. </div>
<div class="buttons">
<%= button_view :outlet => true, :title => 'Close',
@ma11hew28
ma11hew28 / body.haml
Created August 15, 2008 22:14
This is the default sproutcore body.rhtml file translated from erb to haml.
- content_for('body') do
.sc-welcome
%img{:class => "logo", :src => static_url('images/sproutcore-logo')}
.message
%h1 Welcome!
%h3 You are now running SproutCore.
.sticky-note
%p Things to do:
%ul
%li<
@ma11hew28
ma11hew28 / NoMethodError
Created August 16, 2008 15:11
undefined method `capture_haml' for SproutCore::ViewHelperSupport:Module - (NoMethodError)
#<SproutCore::Bundle:0x1a137e4>
~ Building Html: index.html
~ Started request handling: Sat Aug 16 11:06:50 -0400 2008
~ Params: {"action"=>"main", "controller"=>"sprout_core_bundle_controller_0"}
~ undefined method `capture_haml' for SproutCore::ViewHelperSupport:Module - (NoMethodError)
/Library/Ruby/Gems/1.8/gems/sproutcore-0.9.16/lib/sproutcore/helpers/capture_helper.rb:36:in `content_for'
/Library/Ruby/Gems/1.8/gems/sproutcore-0.9.16/lib/sproutcore/view_helpers.rb:554:in `render_view'
(eval):3:in `view'
(haml):2:in `to_html'
/Library/Ruby/Gems/1.8/gems/haml-2.0.2/lib/haml/helpers.rb:400:in `call'
// ==========================================================================
// Admin.TopicFeatureView
// ==========================================================================
require('core');
require('views/collection/collection');
require('views/label');
/** @class
// ==========================================================================
// Admin.AppController
// ==========================================================================
require('core');
/** @class
(Document Your View Here)
@ma11hew28
ma11hew28 / body.rhtml
Created August 29, 2008 02:30
SC custom test view
<%= view :test_view, :view => 'Admin.TestView',
:bind => {:value => 'Admin.masterController.test'} %>
@ma11hew28
ma11hew28 / .bash_profile
Last active September 4, 2015 20:34
.bash_profile file
# Homebrew, Ruby, Bash Completion
# After upgrading Ruby, run: gem pristine --all --only-executables
export PATH="/usr/local/bin:/usr/local/opt/ruby/bin:$PATH"
if [ -f $(brew --prefix)/etc/bash_completion ]; then
. $(brew --prefix)/etc/bash_completion
fi
# Directory Shortcuts
alias prj='cd "$HOME/Projects/"'
@ma11hew28
ma11hew28 / .vimrc
Last active September 5, 2015 07:34
.vimrc file
" set nocompatible
syntax on
" set ruler " show [line], [column] of cursor in bottom right of window (hurts performance)
" set nu " show line numbers
" set columns=80
" filetype plugin indent on " load custom settings based on file type
" set spell spelllang=en_us
" set softtabstop=2 shiftwidth=2 expandtab
" set splitright
@ma11hew28
ma11hew28 / matts-flatten.rb
Created September 9, 2010 05:04
Ruby implementation of flatten for nested arrays
#!/usr/bin/env ruby
class Array
def mattflat
if empty? # base case
self
else
tail = pop
if tail.kind_of? Array
mattflat + tail.mattflat