Skip to content

Instantly share code, notes, and snippets.

@movesmyers
movesmyers / toggle_hidden.scpt
Created February 4, 2015 11:03
An AppleScript to toggle showing or hiding hidden files system-wide
set isHidden to do shell script "defaults read com.apple.finder AppleShowAllFiles"
if (isHidden = "TRUE") then
do shell script "/bin/bash -c 'defaults write com.apple.finder AppleShowAllFiles FALSE && killall Finder'"
else
do shell script "/bin/bash -c 'defaults write com.apple.finder AppleShowAllFiles TRUE && killall Finder'"
end if
@movesmyers
movesmyers / sinatra_skeleton.rb
Last active December 20, 2015 14:59
A short script to create a Sinatra project skeleton to my liking. Assumes you are using erb, sass, and passenger.
#!/usr/bin/env ruby
require 'fileutils'
##
# Creates a Sinatra project skeleton.
# Assumes you are using erb, sass, and passenger.
project_name = ""
if ARGV[0]
# The 'Person' class represents the basic attributes of a person in the application.
class Person
# Define a setter and getter for the "name" attribute
attr_accessor :name
# Pass a name to the 'new' method to initialize a person with their name.
def initialize(name)
@name = name
end
@movesmyers
movesmyers / gist:6038990
Created July 19, 2013 13:07
replace all spaces in all filenames with underscores in working directory
ls -1 *.avi | while read file; do new_file=$(echo $file | sed s/\ /_/g); mv "$file" "$new_file"; done
#!/bin/bash
# curl -s https://gist.githubusercontent.com/movesmyers/5412517/raw | sudo bash
sudo apt-get install -y curl build-essential git-core bison openssl libreadline6 libreadline6-dev zlib1g zlib1g-dev libghc6-zlib-dev libssl-dev libyaml-dev libxml2-dev libxslt1-dev autoconf libc6-dev libncurses5-dev libcurl4-openssl-dev libruby apache2-prefork-dev libapr1-dev libaprutil1-dev libffi-dev tcl-dev tk-dev
cd ~ && curl -O http://cache.ruby-lang.org/pub/ruby/2.1/ruby-2.1.2.tar.gz && tar -xvf ruby-2.1.2.tar.gz && cd ruby-2.1.2
./configure && make && make test && sudo make install