Skip to content

Instantly share code, notes, and snippets.

@cmckni3
cmckni3 / symfony-mac.sh
Last active October 4, 2015 06:08
symfony propel setup for Mac OS X
# this script sets up a new symfony 1.4.x installation and installs the propel ORM plugin on Mac OS X
#!/bin/bash
if [ $# == 0 ]; then
echo "Usage: $0 projectname"
exit 1
fi
mkdir $1 && cd $1
@cmckni3
cmckni3 / rbenv-bash.bash
Last active October 13, 2015 23:27
install rbenv on a Linux/Mac account
#!/usr/bin/bash
# Clone rbenv and set it up to build versions of ruby
git clone git://github.com/sstephenson/rbenv.git .rbenv
mkdir -p ~/.rbenv/plugins
cd ~/.rbenv/plugins
git clone git://github.com/sstephenson/ruby-build.git
# Optional
rails ~>3.2.22
padrino
chef
vagrant
cocoapods
rails_apps_composer
flog
flay
heckle
roo
@cmckni3
cmckni3 / README.md
Last active January 30, 2024 22:32
Objective-C Clean Style

Style settings for Objective-C in XCode

require "#{File.dirname(__FILE__)}/../lib/transactions.rb"
include Transactions
def capture_stdout(&block)
original_stdout = $stdout
$stdout = fake = StringIO.new
begin
yield
ensure
$stdout = original_stdout
describe('Model', function(){
it('something', function(done){
request('http://google.com', function(response){
console.log(response);
done();
})
});
});
#import "canopy.js"
cacheControls();
verifyText('notclicked', "Not Clicked");
tap("clickme");
verifyText('notclicked', "Clicked");
@cmckni3
cmckni3 / speed.r
Last active August 29, 2015 14:04
speed <- 55
distance <- 2
speeds <- seq(54, 0)
h <- function(x) ceiling((distance / (speed - x)) * 3600)
g <- Vectorize(h)
times = g(speeds)
@cmckni3
cmckni3 / version-detection.m
Last active August 29, 2015 14:06
Detect Mac OS X Version
NSDictionary *systemVersionDictionary = [NSDictionary dictionaryWithContentsOfFile:@"/System/Library/CoreServices/SystemVersion.plist"];
NSString *reqSysVer = @"10.7";
NSString *currSysVer;
currSysVer = [systemVersionDictionary objectForKey:@"ProductVersion"];
// For testing
// currSysVer = @"10.10";
if ([currSysVer compare:reqSysVer options:NSNumericSearch] != NSOrderedAscending)
NSLog(@"Version requirement met");
else
NSLog(@"Version requirement not met");
@cmckni3
cmckni3 / progressbar.cpp
Created February 3, 2016 16:21
progressbar.cpp
#include <iostream>
using namespace std;
int main()
{
int count = 0;
string temp = "";
while (count < 10)
{