Skip to content

Instantly share code, notes, and snippets.

@sixman9
sixman9 / GitCVSImportCMD.txt
Created November 11, 2010 16:51
Sample Git CVS Import command
git cvsimport -p -x -v -k -o cvsheadbranch -s _ -duser.name@127.0.0.1:/dir/cvsroot -C newGitDir 'CVS MODULE NAME'
@sixman9
sixman9 / Piston code import gem example
Created November 17, 2010 17:36
Piston implements 'Vendor Branching' - link sections of 3rd party versioned code into your project, preserving revisions!
#like svn:externals, only you can update the code!!!!
#install (*nix) - easy! See http://piston.rubyforge.org/
#Assuming BASH
[sudo] gem install piston
#Usage - import remote subtree/directory to required project destination
piston import -v0 [--repository-type git|svn] <url/of/git/or/svn/repository> <destination/directory>
@sixman9
sixman9 / Maven Android Archetype(s)
Created November 26, 2010 14:12
Archetypes to aid Maven Android development
mvn archetype:generate -DarchetypeCatalog=http://kallisti.eoti.org:8081/content/repositories/snapshots/archetype-catalog.xml
See http://malsandroid.blogspot.com/2010/04/galatea-mavenandroid-archetype.html
you need to run this once with Active SDK = Simulator, and once with Active SDK = Device - for some reason, if you don't, Xcode says "i386 is not a valid architecture, only armv6 and armv7 are valid". But, once you've done that once, it works fine thereafter.
Wow. I think I've done it - automatic, full integration with XCode GUI! (based on Eonil's code)
NB: several changes, the biggest being that this is recursion-safe (it can be called from INSIDE a build-step, and won't crash if you do).
Usage:
Create a static lib project
Select the Target
@sixman9
sixman9 / log4j.properties
Created December 8, 2010 17:24
Log4j Property file sample
log4j.rootLogger=INFO, logfile
log4j.logger.org.springframework.web.context=DEBUG, stdout
# in case any output is given to stdout, format it
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - %m%n
log4j.appender.logfile=org.apache.log4j.RollingFileAppender
log4j.appender.logfile.File=myproject.log
@sixman9
sixman9 / CMakeLists.txt
Created December 14, 2010 10:42
cmake files for Apple IOS development (has C++ lean, can be adapted however)
# See original post at http://stackoverflow.com/questions/822404/how-to-set-up-cmake-to-build-an-app-for-the-iphone
cmake_minimum_required(VERSION 2.8)
cmake_policy(SET CMP0015 NEW)
cmake_policy(SET CMP0016 NEW)
project(test)
set(NAME test)
@sixman9
sixman9 / Awk variable assignment for loop
Created January 9, 2011 06:29
Awk variable assignment for loop
for myFileSetVar in `find /some/path -iname '*some.file*'`; do newAwkVar=`echo $myFileSetVar | awk -F/ '{print $1}'`; echo $newAwkVar came from $myFileSetVar; done
@sixman9
sixman9 / java-ikvm-dotnet
Created January 13, 2011 16:57
Using IKVM to generate a C# assembly (dll) from a Java jar file
See http://stackoverflow.com/questions/2947990/using-ikvm-to-convert-a-jar-flying-saucer-xhtmlrenderer
I wanted to use the Flying Saucer Java API in .NET so I tried to use IKVM to convert the Flying Saucer library:
ikvmc core-renderer.jar
For some reason, IKVMC gave me an exe core-renderer.exe so I renamed it to core-renderer.dll, added to my assemblies and hacked away
using java.io;
using java.lang;
using com.lowagie.text;
@sixman9
sixman9 / Lazy Bean Spring
Created January 21, 2011 11:37
How to setup a lazy-loaded bean in Spring.
<!-- Lazy load (at request time) a Spring bean -->
<bean id="someBeanLazy" class="org.springframework.aop.framework.ProxyFactoryBean">
<property name="targetSource">
<bean class="org.springframework.aop.target.LazyInitTargetSource">
<property name="targetBeanName" value="someRealBean" />
<property name="targetClass">
<bean class="java.lang.Class" factory-method="forName">
<constructor-arg value="com.package.TheClassToMakeLazy"/>
</bean>
</property>
@sixman9
sixman9 / OpenTK Matrix4.LookAt()
Created January 25, 2011 17:35
OpenTK version of OpenGL's GluLookAt()function
Matrix4 lookat = Matrix4.LookAt(cameraPositionX, cameraPositionY, cameraPositionZ, 256, 0, 256, 0.0, 1.0, 0.0);
GL.MatrixMode(MatrixMode.Modelview);
GL.LoadMatrix(ref lookat);