Skip to content

Instantly share code, notes, and snippets.

@ggerard
ggerard / screen-docker-for-mac.sh
Created August 28, 2017 23:55 — forked from BretFisher/docker-for-mac.md
Screen Commands for Docker for Mac (prevent garbled text on reconnect)
# connect to tty on Docker for Mac VM
screen ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/tty
# disconnect that session but leave it open in background
Ctrl-a d
# list that session that's still running in background
screen -ls
# reconnect to that session (don't open a new one, that won't work and 2nd tty will give you garbled screen)
App.IndexView = Ember.View.extend({
bindCopyButton: function() {
var self = this;
var controller = this.get('controller');
var copyButton = this.$('.copy-button');
var clip = new ZeroClipboard(copyButton);
clip.on('dataRequested', function (client, args) {
client.setText(document.location.href);
controller.set('justCopied', true);
setTimeout(function() {
#import "NSData+OADataHelpers.h"
@implementation NSData (OADataHelpers)
- (NSString*) UTF8String
{
return [[[NSString alloc] initWithData:[self dataByHealingUTF8Stream] encoding:NSUTF8StringEncoding] autorelease];
}
// Replaces all broken sequences by � character and returns NSData with valid UTF-8 bytes.
@ggerard
ggerard / .bashrc
Created March 28, 2013 08:43 — forked from RonTai/.bashrc
# vim:ts=4:sw=4
export PATH=/usr/local/apache2/bin:/usr/local/git/bin:/usr/local/ruby/bin:$PATH
#export PATH=/usr/local/apache2/bin:/usr/local/ruby/bin:$PATH
#export TERM=xterm-256color
export HISTSIZE=10000
export JAVA_HOME=/usr/local/jdk1.7.0_17
export PATH=$PATH:$JAVA_HOME/bin
export PATH=$PATH:/root/bin
#!/bin/sh
#
# Copyright (c) 2010 Warren Merrifield
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@ggerard
ggerard / Spring3_Hibernate4_Configiration.xml
Created April 26, 2012 01:18
Spring 3.1, Hibernate 4 and Jboss 7 configuration
<!--Transactions are managed by Spring. I am not sure which transaction factory should be used for 'hibernate.transaction.factory_class'. I
feel it should be org.hibernate.engine.transaction.internal.jta.JtaTransactionFactory because we get BMT with Spring. Check
https://hibernate.onjira.com/browse/HHH-7215. So far I have not seen any side effects of this configuration probably because Jboss TS
transaction related data is thread bound and both UserTransaction and TransactionManager implementations will have reference to transaction
instance with same state.Please comment if you see any side effects of this configuration-->
<bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
<property name="dataSource"><ref bean="dataSource" /></property>
<property name="hibernateProperties">
<value>
hibernate.dialect=org.hibernate.dialect.Oracle10gDialect