This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a Duck. It is clearly not a string. | |
class Duck | |
def to_s | |
" _ \n" + | |
"__(.)<\n" + | |
"\\___) \n" | |
end | |
end | |
# This displays Strings. It will clearly never display a Duck. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun decode-entities (dirty-string) | |
"Interprets a string of space-separated numbers as an | |
ASCII string" | |
(mapconcat (lambda (x) (format "%c" (string-to-number x))) | |
(split-string (clean-encoded-string dirty-string)) | |
"")) | |
(defun clean-encoded-string (string) | |
"Removes useless characters and replaces linebreaks with a | |
line-feed (LF) char." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>BuildMachineOSBuild</key> | |
<string>11B26</string> | |
<key>CFBundleDevelopmentRegion</key> | |
<string>English</string> | |
<key>CFBundleExecutable</key> | |
<string>CoffeeScript</string> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(setq | |
scripts-dired-find-owner | |
"tell application \"Finder\" | |
set appname to (default application of (info for POSIX file \"%s\")) | |
do shell script \"echo \" & appname | |
end tell") | |
(setq | |
scripts-dired-open-from-finder |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
These two files should help you to import passwords from mac OS X keychains to 1password. | |
Assumptions: | |
1) You have some experience with scripting/are a power-user. These scripts worked for me | |
but they haven't been extensively tested and if they don't work, you're on your own! | |
Please read this whole document before starting this process. If any of it seems | |
incomprehensible/frightening/over your head please do not use these scripts. You will | |
probably do something Very Bad and I wouldn't want that. | |
2) You have ruby 1.9.2 installed on your machine. This comes as standard with Lion, previous | |
versions of OS X may have earlier versions of ruby, which *may* work, but then again, they |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INFO 17:54:23.546 (WildcardExceptionMapper) Exception intercepted by WildcardExceptionMapper: | |
org.modeshape.jcr.value.ValueFormatException: Error converting InputStream to a BinaryValue | |
at org.modeshape.jcr.value.binary.BinaryStoreValueFactory.create(BinaryStoreValueFactory.java:268) ~[modeshape-jcr-3.6.0.Final.jar:3.6.0.Final] | |
at org.modeshape.jcr.value.binary.BinaryStoreValueFactory.create(BinaryStoreValueFactory.java:57) ~[modeshape-jcr-3.6.0.Final.jar:3.6.0.Final] | |
at org.modeshape.jcr.JcrValueFactory.createBinary(JcrValueFactory.java:153) ~[fcrepo-kernel-4.0.0-alpha-3-SNAPSHOT.jar:na] | |
at org.modeshape.jcr.JcrValueFactory.createBinary(JcrValueFactory.java:47) ~[fcrepo-kernel-4.0.0-alpha-3-SNAPSHOT.jar:na] | |
at org.fcrepo.kernel.Datastream.setContent(Datastream.java:152) ~[fcrepo-kernel-4.0.0-alpha-3-SNAPSHOT.jar:na] | |
at org.fcrepo.kernel.services.DatastreamService.createDatastreamNode(DatastreamService.java:138) ~[fcrepo-kernel-4.0.0-alpha-3-SNAPSHOT.jar:na] | |
at org.fcrepo.http.api.FedoraContent.creat |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Fix up a git repo containing submodules that have absolute paths which have changed. | |
# | |
# Note that this doesn't do the *proper* fix, which is to turn the absolute paths into | |
# relative paths. This is possible, but would require a lot more logic because the relative | |
# paths would be different in each case. | |
# | |
# What it does instead is a pragmatic workaround, which is to search & replace the old | |
# path with a new (and presumably correct) one. This will get you up and running again. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Jekyll Generator for SCSS | |
# | |
# (File paths in this description relative to jekyll project root directory) | |
# Place this file in ./_plugins | |
# Place .scss files in ./_scss | |
# Compiles .scss files in ./_scss to .css files in whatever directory you indicated in your config | |
# Config file placed in ./_sass/config.rb | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'nokogiri' | |
require 'open-uri' | |
require 'upmark' | |
require 'cgi' | |
require 'uri' | |
class TootReader | |
ACTIVITY_NAMESPACE = 'http://activitystrea.ms/spec/1.0/'.freeze | |
COMMENT_TYPE = 'http://activitystrea.ms/schema/1.0/comment'.freeze |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
default: all | |
SRC := $(wildcard *.c) | |
EXE := $(SRC:.c=) | |
all: $(EXE) | |
%: %.c | |
clang $< -o $@ |
OlderNewer