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
function parse_git_branch | |
{ | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1) /' | |
} | |
function proml | |
{ | |
PS1="[\w\$(parse_git_branch)]$" | |
} | |
proml |
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 | |
ruby_string="ruby-1.8.7-p357" | |
#ruby_string="ruby-1.9.3-p194" | |
gemset_name="cke2" | |
if rvm list strings | grep -q "${ruby_string}" ; then | |
# Load or create the specified environment | |
if [[ -d "${rvm_path:-$HOME/.rvm}/environments" \ |
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
class YourBody { | |
boolean is_moving = false; | |
String[] known_actions = { “Forward”, “Backward”, “Left”, “Right” }; | |
boolean validRequest( String this_action ){ | |
for ( int i = 0; i < known_actions.length; i++) | |
{ | |
if ( known_actions[i] == this_action ) | |
{ | |
return true; |
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
class YourBody { | |
boolean is_moving = false; | |
String[] known_actions = { "Forward", "Backward", "Left", "Right" }; | |
boolean validRequest( String this_action ){ | |
for ( int i = 0; i < known_actions.length; i++) | |
{ | |
if ( known_actions[i] == this_action ) | |
{ | |
return true; |
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
#CONFIG TERMINAL | |
export CLICOLOR=1 | |
export LSCOLORS=GxFxCxDxBxegedabagaced | |
#sets up the prompt color (currently a green similar to linux terminal) | |
#enables color for iTerm | |
export TERM=xterm-color | |
export EC2_HOME=/Users/lsmolic/.ec2 | |
export EC2_PRIVATE_KEY=`ls $EC2_HOME/pk-*.pem` | |
export EC2_CERT=`ls $EC2_HOME/cert-*.pem` | |
#export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_21.jdk/Contents/Home |
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
desc <<-DESC | |
Deploy the system directory to production | |
DESC | |
task :fs, :roles => :web, :once => true do | |
servers = find_servers_for_task(current_task) | |
puts "SERVERSSSSSSS......>>>>>>>> #{servers}" | |
servers.each do |server| | |
port = 22 | |
Array(fetch(:sync_directories, [])).each do |syncdir| | |
destination, base = Pathname.new(syncdir).split |
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
awsmsce:Hey everyone, quick question (hopefully) regarding URIs. wondering where there is a different uri for the same card when you refer to it from active_card and what the tokenizer returns | |
[2:48pm]jacobolus:hi awsmsce | |
[2:48pm]jacobolus:awsmsce: can you elaborate a bit? | |
[2:49pm]jacobolus:what's the "tokenizer"? | |
[2:49pm]awsmsce:when you tokenize a code, the api returns a URI for a card.. without a customer associated: | |
[2:49pm]jacobolus:yes | |
[2:50pm]awsmsce:however this differs from the URI that is returned when looking up a customer's active card | |
[2:50pm]awsmsce:but shouldn't the URI always be the same? | |
[2:50pm]awsmsce:the ID doesn't change | |
[2:50pm]jacobolus:if you tokenize a new card, then that card's URI is going to differ from a customer's existing card...? |
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
f0ster left the chat room. (Ping timeout: 240 seconds) | |
[10:37am] JSeligstein: remear: how would I know which one to use without also storing my token? | |
[10:37am] ras__: skylar: it'll have all the same cards and bank accounts attached on Customer that it does on Account | |
[10:37am] remear: JSeligstein: if you did something like customer.debit it would default to the most recently added | |
[10:38am] skylar: ras__ so Balanced::Account.find(uri).customer_uri ? | |
[10:39am] remear: to debit a specific one just pass the URI for it as source_uri. how you determine which one you want to debit is up to you. some people allow only one card at a time and so store the URI for it. others allow multiple cards to pick from | |
[10:39am] remear: skylar: yes | |
[10:39am] skylar: thanks! that's helpful | |
[10:39am] JSeligstein: remear: okay, i'll just store the uri for the specific card then | |
[10:39am] JSeligstein: remear: thanks |
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
AVAssetExportSession *exportSession = [[AVAssetExportSession alloc] initWithAsset:[self.project.composition copy] presetName:AVAssetExportPresetPassthrough]; | |
NSURL* outputURL = [self createTempAssetFileURL:@"export"]; | |
exportSession.outputURL = outputURL; | |
// exportSession.outputFileType=AVFileTypeQuickTimeMovie; | |
exportSession.outputFileType=AVFileTypeMPEG4; | |
[exportSession exportAsynchronouslyWithCompletionHandler:^{ | |
switch (exportSession.status) { | |
case AVAssetExportSessionStatusFailed:{ |
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
NSDictionary *videoCleanApertureSettings = [NSDictionary dictionaryWithObjectsAndKeys: | |
@480, AVVideoCleanApertureWidthKey, | |
@480, AVVideoCleanApertureHeightKey, | |
@0, AVVideoCleanApertureHorizontalOffsetKey, | |
@0, AVVideoCleanApertureVerticalOffsetKey, | |
nil]; | |
NSDictionary *videoAspectRatioSettings = [NSDictionary dictionaryWithObjectsAndKeys: | |
@1,AVVideoPixelAspectRatioHorizontalSpacingKey, |
OlderNewer