- Install VirtualBox on your machine
- Disable login credential: $ VBoxManage setproperty websrvauthlibrary null
- Download and uncompress the following image https://s3.amazonaws.com/vmfest-images/ubuntu-10-10-64bit-server.vdi.gz
- Clone the image to the directory where you want it to be permanently stored:
$ VBoxManage clonehd /path/to/downloaded/ubuntu-10-10-64bit-server.vdi /path/to/permanent/location/ubuntu...-server.vdi
- This should produce a uuid for your new image. Keep it around
- Start VirtualBox (the GUI) and:
- Create an new image Linux - Ubuntu (64bit)
- Select "Use existing hard disk" and if your newly cloned image doesn't appear in the drop-down list, click on the folder icon and find the image in your hard disk (the one you just cloned)
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
@interface NSObject (OAObjectHelpers) | |
+ (id) performBlock:(void(^)())aBlock afterDelay:(NSTimeInterval)seconds; | |
+ (void) cancelPreviousPerformBlock:(id)aWrappingBlockHandle; | |
@end | |
@implementation NSObject (OAPerformBlockAfterDelay) |
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
;;; C-x c calls jslint and outputs to the *compilation* buffer. | |
(setq jslint-wrapper (concat "java -jar " (substitute-in-file-name "$HOME") "/bin/jslint4java-1.4.4.jar ")) | |
(require 'compile) | |
(add-hook 'javascript-mode-hook | |
(lambda () | |
(set (make-local-variable 'compilation-read-command) nil) | |
(set (make-local-variable 'compile-command) | |
(concat jslint-wrapper buffer-file-name)) | |
(local-set-key (kbd "C-x c") 'compile))) |
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
# turn a jar with a Main-Class into a stand alone executable | |
(echo '#!/usr/bin/env java -jar'; cat blahblah.jar) > blah | |
# turn a jar with a particular main clas into a stand alone executable | |
(echo '#!/usr/bin/env java -jar package.MainClass'; cat blahblah.jar) > blah |
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
public class FieldMacro : AbstractAstMacro | |
{ | |
public override Statement Expand(MacroStatement macro) | |
{ | |
if (macro.Arguments.Count == 1) | |
{ | |
var tryCastExpression = (TryCastExpression)macro.Arguments.First; | |
var referenceExpression = (ReferenceExpression)tryCastExpression.Target; | |
var property = new Property(referenceExpression.Name) |
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
public class NodeList<TKey, TValue> : IEnumerable<KeyValuePair<TKey, TValue>> where TKey : IComparable<TKey> | |
{ | |
readonly Node start = new Node(default(TKey), default(TValue)); | |
public IEnumerator<KeyValuePair<TKey, TValue>> GetEnumerator() | |
{ | |
for (Node n = start.GetNext(); n != null; n = n.GetNext()) | |
{ | |
yield return new KeyValuePair<TKey, TValue>(n.key, n.value); | |
} |
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
describe "GET current" do | |
before do | |
@request.cookies['hidden_notices'] = "1,#{notices(:permanent).id}" | |
get :current, :format => 'js' | |
end | |
it { should respond_with(:success) } | |
it { should set_cookie(:hidden_notices).to("#{notices(:permanent).id}") } | |
it { should render_template('notices/current') } | |
end |
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
-module(accumulators). | |
-export([average/1]). | |
average(X) -> average(X, 0, 0). | |
average([H|T], Length, Sum) -> | |
average(T, Length + 1, Sum + H); | |
average([], Length, Sum) -> | |
Sum / Length. |
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
#!/bin/bash | |
# https://gist.github.com/949831 | |
# http://blog.carbonfive.com/2011/05/04/automated-ad-hoc-builds-using-xcode-4/ | |
# command line OTA distribution references and examples | |
# http://nachbaur.com/blog/how-to-automate-your-iphone-app-builds-with-hudson | |
# http://nachbaur.com/blog/building-ios-apps-for-over-the-air-adhoc-distribution | |
# http://blog.octo.com/en/automating-over-the-air-deployment-for-iphone/ | |
# http://www.neat.io/posts/2010/10/27/automated-ota-ios-app-distribution.html |
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 an Ubuntu appindicator that displays the system load | |
(CPU, memory usage, network traffic). | |
It looks like this: http://imgur.com/W4PCc . | |
Compile with: | |
gcc -Wall `pkg-config --cflags --libs gtk+-2.0 appindicator-0.1 libgtop-2.0` -o indicator-sysload ./indicator-sysload.c |