Skip to content

Instantly share code, notes, and snippets.

View lattejed's full-sized avatar
😀

lattejed lattejed

😀
View GitHub Profile
# 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
//
// Controller.m
//
// Created by Matthew Smith on 4/21/14.
// Copyright (c) 2014 LatteJed. All rights reserved.
//
#import "Controller.h"
#import "Model.h"
//
// 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
//
// 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)
// 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"];
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
ansible-playbook -i hosts.ini bootstrap.yml --user root
# 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: ''
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"
# }
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