This is an OS X-centric configuration.
The idea here is to use environment variables, loaded via aliases to mutt, to control which account you're loading. Years ago I had all of my accounts configured to be accessible from a single mutt
tell application "System Events" | |
-- get current clipboard contents as a string | |
set CurrentClipboard to the clipboard as string | |
-- set the clipboad to your password | |
set the clipboard to "Y0urVPNPa$$w0rd" | |
-- start playing with the VPN | |
tell current location of network preferences | |
//return an array of objects according to key, value, or key and value matching | |
function getObjects(obj, key, val) { | |
var objects = []; | |
for (var i in obj) { | |
if (!obj.hasOwnProperty(i)) continue; | |
if (typeof obj[i] == 'object') { | |
objects = objects.concat(getObjects(obj[i], key, val)); | |
} else | |
//if key matches and value matches or if key matches and value is not passed (eliminating the case where key matches but passed value does not) | |
if (i == key && obj[i] == val || i == key && val == '') { // |
hello from the view | |
<form action="/form" method="post"> | |
<input type="text" name="name"> | |
<input type="submit"> | |
</form> |
#!/usr/bin/env ruby | |
# Dependencies: wget and the following gems: | |
require 'rubygems' | |
require 'feedzirra' | |
require 'httparty' | |
feed_url = 'http://feeds.xlr8r.com/xlr8rmp3s' | |
feed = Feedzirra::Feed.fetch_and_parse(feed_url) |
require 'roo' | |
# Spreadsheet courtesy of the A List Apart 2010 Web Design Survey: | |
# http://www.alistapart.com/articles/survey2010 | |
workbook = Excel.new('a-list-apart-web-design-survey-sample.xls') | |
# Set the worksheet you want to work with as the default worksheet. You could | |
# also iterate over all the worksheets in the workbook. | |
workbook.default_sheet = workbook.sheets[0] |
require 'fileutils' | |
path = '/Users/rubyginner/Downloads' | |
docs = ['.pdf', '.epub', '.txt', '.rtf'] | |
pics = ['.png', '.gif', '.jpg', '.jpeg','.bmp', '.JPEG', '.JPG'] | |
music = ['.mp3', '.wav'] | |
videos = ['.mp4', '.wmv', '.flv', '.mov', '.mpeg'] | |
apps = ['.dmg', '.pkg'] | |
archive = ['.zip', '.tar'] |
data_sets <- c("mtcars", "morley", "rock") | |
shinyServer(function(input, output) { | |
# Drop-down selection box for which data set | |
output$choose_dataset <- renderUI({ | |
selectInput("dataset", "Data set", as.list(data_sets)) | |
}) | |
# Check boxes |
class PdfMerger | |
def merge(pdf_paths, destination) | |
first_pdf_path = pdf_paths.delete_at(0) | |
Prawn::Document.generate(destination, :template => first_pdf_path) do |pdf| | |
pdf_paths.each do |pdf_path| | |
pdf.go_to_page(pdf.page_count) |
This is an OS X-centric configuration.
The idea here is to use environment variables, loaded via aliases to mutt, to control which account you're loading. Years ago I had all of my accounts configured to be accessible from a single mutt
#!/bin/bash | |
# MacTeX uninstaller script based on pkgutil command | |
# by Akihiro Uchida, CC0 dedicated to the public domain | |
# see http://creativecommons.org/publicdomain/zero/1.0/ | |
IFS=$(echo -en "\n") | |
for pkg in $(pkgutil --pkgs|grep org.tug.mactex); do | |
volume="$(pkgutil --pkg-info "$pkg"|grep volume|cut -d' ' -f2-)" | |
location="$(pkgutil --pkg-info "$pkg"|grep location|cut -d' ' -f2-)" | |
echo "remove all of the files installed under the $pkg" | |
for file in $(pkgutil --files "$pkg"); do |