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
# After you've installed the Haskell platform set up Stackage for cabal: | |
# This is the Stackage URL I used: | |
# remote-repo:stackage:http://www.stackage.org/stackage/b17902988efbf57733fa4270a2ea60e9d988098d | |
# Just replace the current remote-repo:... line in ~/.cabal/config with the one above | |
# Load the list of packages from Stackage | |
cabal update | |
# Install Yesod | |
cabal install alex happy yesod-bin |
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
// | |
// Controller.m | |
// | |
// Created by Matthew Smith on 4/21/14. | |
// Copyright (c) 2014 LatteJed. All rights reserved. | |
// | |
#import "Controller.h" | |
#import "Model.h" |
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
// | |
// Model.h | |
// | |
// Created by Matthew Smith on 5/21/14. | |
// Copyright (c) 2014 LatteJed. All rights reserved. | |
// | |
static NSString* const kNotificationURLDidUpdate = @"kNotificationURLDidUpdate"; | |
@interface Model : NSObject |
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
// | |
// NSButton+LJBlocks.h | |
// | |
// Created by Matthew Smith on 4/21/14. | |
// Copyright (c) 2014 LatteJed. All rights reserved. | |
// | |
#import <Cocoa/Cocoa.h> | |
@interface NSButton (LJBlocks) |
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
// Example app delegate for RestKit + Core Data config | |
// Import Core Data and RestKit, in that order | |
#import <CoreData/CoreData.h> | |
#import <RestKit/RestKit.h> | |
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions | |
{ | |
// Configure the global object manager with your API's base url | |
NSURL *baseURL = [NSURL URLWithString:@"https://your-api.example.com"]; |
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
int fromPPQ15360TicksToSamples (int ticks, int tempo, int sampleRate) | |
{ | |
// ticks -> samples | |
// 3.9025 = 60000 (milliseconds / min) / 15360 (ticks per quarter note) | |
return (3.9025 * sampleRate * ticks) / (double)tempo; | |
} | |
int fromSamplesToPPQ15360Ticks (int sampleOffset, int tempo, int sampleRate) | |
{ | |
// samples -> ticks |
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
ansible-playbook -i hosts.ini bootstrap.yml --user root |
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
# bootstrap.yml | |
--- | |
- hosts: newservers | |
vars: | |
- ubuntu_release: raring | |
- logwatch_email: <your email addy> | |
# crypted passwords, generated on a Linux box using: | |
# echo 'import crypt,getpass; print crypt.crypt(getpass.getpass(), "$6$YOURSALT")' | python - | |
- root_password: '' |
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
echo "<your server ip x.x.x.x>" > host.ini | |
ansible all -i host.ini -m ping -u root | |
# x.x.x.x | success >> { | |
# "changed": false, | |
# "ping": "pong" | |
# } |
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
git clone git://github.com/ansible/ansible.git | |
cd ./ansible | |
sudo make install | |
sudo easy_install jinja2 | |
sudo easy_install pyyaml | |
sudo easy_install paramiko | |
source ./hacking/env-setup |