Skip to content

Instantly share code, notes, and snippets.

@mvpotter
mvpotter / gist:9434633
Created March 8, 2014 16:39
Install proprietary maven dependency
mvn install:install-file -Dfile=c:\kaptcha-{version}.jar -DgroupId=com.google.code -DartifactId=kaptcha -Dversion={version} -Dpackaging=jar
@mvpotter
mvpotter / download_file.py
Created February 19, 2014 09:08
Download large files using python
def download_file(url):
local_filename = url.split('/')[-1]
# NOTE the stream=True parameter
r = requests.get(url, stream=True)
with open(local_filename, 'wb') as f:
for chunk in r.iter_content(chunk_size=1024):
if chunk: # filter out keep-alive new chunks
f.write(chunk)
f.flush()
return local_filename
@mvpotter
mvpotter / .gitignore
Created February 3, 2014 04:07
.gitignore for Unity3d project
.DS_Store
.svn/
Library/
Etc/
Temp/
Assets/Persistence/
*.userprefs
*.unityproj
@mvpotter
mvpotter / pom.xml
Created January 17, 2014 07:51
Get revision number for module using maven
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>buildnumber-maven-plugin</artifactId>
<configuration>
<buildNumberPropertyName>buildRevision</buildNumberPropertyName>
<timestampPropertyName>buildTimestamp</timestampPropertyName>
<revisionOnScmFailure>unavailable</revisionOnScmFailure>
<useLastCommittedRevision>true</useLastCommittedRevision>
<doUpdate>true</doUpdate>
@mvpotter
mvpotter / gist:7984592
Last active December 31, 2015 12:09
Merge commit from trunk to brunchIt should be done in the directory of the branch. The revision number 1002 will be merged.
svn merge -c 1002 https://svn.dev.your/repo/trunk/src .