Skip to content

Instantly share code, notes, and snippets.

Max Ovsiankin maxov

View GitHub Profile
maxov /
Last active Aug 29, 2015
java heterogenous lists madness
public abstract class HList {
public abstract int length();
public static H0 of() {
return Nil;
public static <T1> H1<T1> of(T1 v1) {
return new H1<T1>(v1);
maxov /
Last active Aug 29, 2015
it's turtles all the way down
{ "Ticker": "IBM" } 
  <json:string name="Ticker">IBM</json:string>
interface DataManipulator {
void clear();
void from(DataHolder holder);
interface DisplayNameData extends DataManipulator {
View throw.gradle
project.getGradle().buildFinished { result ->
def failure = result.getFailure()
if (failure) {
def cause = failure.getCause().getCause().getCause()
throw new RuntimeException("no, this is what I want it to say!")
View pull-buttons.html
<!-- in .merge-messages after first button, before .js-details-container -->
<a data-url="github-mac://openRepo/" class="button desktop-app-action js-conduit-rewrite-url tooltipped tooltipped-s" aria-label="Check out this branch">
<span class="octicon octicon-device-desktop"></span>
<!-- in .discussion-sidebar after .partial-discussion-stats, before first .discussion-sidebar-item -->
<button class="minibutton primary" style="width: 100%">Pull Locally</button>
<!-- with icon -->
<button class="minibutton primary" style="width: 100%"><span class="octicon octicon-device-desktop"></span> Pull Locally</button>
maxov / plugin.json
Last active Aug 29, 2015
soak dependency specification
View plugin.json
"name": "my-plugin",
"owner": "gratimax",
"version": "1.0-SNAPSHOT",
"dependencies": [
["Lapis", "Commons", "1.0-SNAPSHOT"]
"maven": {
"repositories": {
"sponge": "",
maxov /
Last active Aug 29, 2015
message computation
// All lists are immutable
public ComputedMessage computeAll(@Nullable Message parent) {
Message self = null;
if (parent == null) {
self = this;
} else {
self = Messages.compute(parent, self);
View -
FAILURE: Build failed with an exception.
* Where:
Build file '/Users/max/proj/sponge/Soak/Cli/build.gradle' line: 3
* What went wrong:
Error resolving plugin [id: 'com.github.hierynomus.license', version: '0.11.0']
> Plugin 'com.github.hierynomus.license' is already on the script classpath. Plugins on the script classpath cannot be applied in the plugins {} block. Add "apply plugin: 'com.github.hierynomus.license'" to the body of the script to use the plugin.
View -
:compileJava UP-TO-DATE
:processResources UP-TO-DATE
:classes UP-TO-DATE
:javadoc/Users/max/proj/sponge/SpongeAPI/src/main/java/org/spongepowered/api/world/storage/ warning: no description for @return
* @return
/Users/max/proj/sponge/SpongeAPI/src/main/java/org/spongepowered/api/plugin/ warning: no @return
String id();
/Users/max/proj/sponge/SpongeAPI/src/main/java/org/spongepowered/api/plugin/ warning: no @return
from django.db.models import Q, F
from perms.spaces import QueryPermissionSpace
from repo.models import Project
space = QueryPermissionSpace()
def resolve_project_perms(perm, user):
return Project.objects.filter(
You can’t perform that action at this time.