Skip to content

Instantly share code, notes, and snippets.

View sarnobat's full-sized avatar

sarnobat

View GitHub Profile
@yamalight
yamalight / README.md
Last active January 13, 2023 11:18
Feedly Colorful Listview
@ldong
ldong / DiffMerge_Change_font.md
Created September 30, 2015 21:31
Change Git: Change DiffMerge Font-Size on Mac OSX

Git: Change DiffMerge Font-Size on Mac OSX

open -e ~/Library/Preferences/SourceGear\ DiffMerge\ Preferences

Append this to it

[File]
Font=22:76:consolas
@inooid
inooid / .bash_profile
Created March 16, 2015 09:34
Google command to search on Google from the command line (Mac OS X)
# Command to open the webbrowser and immediately start searching
# for the right keyword.
#
# Usage:
# $ google test query
# $ => Opens the browser on http://www.google.com/search?q=test+query
#
google()
{
@venkatperi
venkatperi / gist:9664988
Created March 20, 2014 14:31
Walk up project tree to resolve project (ext) properties in Gradle
//root build.gradle
ext {
javaVersion = JavaVersion.VERSION_1_7
}
Project.metaClass.prop { name ->
delegate.with {
ext.properties.containsKey( name ) ?
ext.properties[ name ] : parent?.prop( name )
}
DSLContext database = Mockito.mock(DSLContext.class, Mockito.RETURNS_DEEP_STUBS);
Mockito.when(database.select(ACTIVITY_TYPE.ID)
.from(ACTIVITY_TYPE)
.where(ACTIVITY_TYPE.SINGLE_PERSON_USABLE.isTrue())
.fetch(ACTIVITY_TYPE.ID))
.thenReturn(ImmutableList.of(singleActivityTypeId));
Mockito.when(database.select(ACTIVITY_TYPE.ID)
.from(ACTIVITY_TYPE)
tell application "System Events"
--set visible of every process whose visible is true and name is not in {"Finder", name of current application} to false
set visible of every process whose visible is true and name is not "Finder" and frontmost is false to false
end tell
@rmorenobello
rmorenobello / setSystemPropertyFromCLI.groovy
Last active November 2, 2020 04:46
How to set and retrieve JVM system variables when running java/groovy from CLI
// http://stackoverflow.com/questions/8098564/is-it-possible-to-specify-java-system-properties-when-running-groovy-from-comman
/*
System properties are set on the java command line using the
java -Dpropertyname=value
syntax.
They can also be added at runtime using
System.setProperty(name, value)
or via the various
System.getProperties().load()
methods.
@pascalalich
pascalalich / eclipse-templates.xml
Created February 18, 2015 06:59
Eclipse Templates for Java logging, hashCode, equals, and toString with SLF4J and Guava
<?xml version="1.0" encoding="UTF-8" standalone="no"?><templates><template autoinsert="true" context="java" deleted="false" description="equals (Guava)" enabled="true" name="equals">${:import(com.google.common.base.Objects)}&#13;
@Override&#13;
public boolean equals(final Object obj) {&#13;
if (this == obj) {&#13;
return true;&#13;
}&#13;
if (obj == null) {&#13;
return false;&#13;
}&#13;
if (getClass() != obj.getClass()) {&#13;