Skip to content

Instantly share code, notes, and snippets.

@defunkt
defunkt / clients.md
Created April 18, 2010 14:09
A list of Gist clients.

Gist Clients

Want to create a Gist from your editor, the command line, or the Services menu? Here's how.

Editor Support

@EmilHernvall
EmilHernvall / WordTrainer.java
Created May 3, 2011 18:34
A tiny java-program for language training
/**
* WordTrainer 2008-12-02
* Simple language training in Java. This program accepts text-files
* containing where each line contains two words in two diffrent languages
* separated by a comma (,). The first line follows the same format but
* specifies the language.
*
* Sample gloss-file:
* Engelska,Svenska
* cloud,moln
@pksunkara
pksunkara / config
Last active July 25, 2024 15:53
Sample of git config file (Example .gitconfig) (Place them in $XDG_CONFIG_HOME/git)
[user]
name = Pavan Kumar Sunkara
email = pavan.sss1991@gmail.com
username = pksunkara
[init]
defaultBranch = master
[core]
editor = nvim
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
pager = delta
@vorburger
vorburger / CopyResourcesFromClassPathToFilesystemDirectory.java
Created July 3, 2011 22:29
Copy resources from Classpath into a temporary directory
import java.io.File;
import java.io.IOException;
import java.net.URL;
import org.apache.commons.io.FileUtils;
import org.springframework.core.io.Resource;
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
import org.springframework.core.io.support.ResourcePatternResolver;
val projectCommand = AttributeKey[Boolean]("project-command", "Marks Commands that were registered for the current Project.")
val sessionSettings = AttributeKey[SessionSettings]("session-settings", "Tracks current build, project, and setting modifications.")
val stateBuildStructure = AttributeKey[Load.BuildStructure]("build-structure", "Data structure containing all information about the build definition.")
val logged = AttributeKey[Logger]("log", "Provides a Logger for commands.")
val analysis = AttributeKey[inc.Analysis]("analysis", "Analysis of compilation, including dependencies and generated outputs.")
val globalBaseDirectory = AttributeKey[File]("global-base-directory", "The base directory for global sbt configuration and staging.")
val isModule = AttributeKey[Boolean]("is-module", "True if the target is a module.")
val isDummyTask = AttributeKey[Boolean]("is-dummy-task", "Internal: used to identify dummy tasks. sbt injects values for these tasks at the start of task execution.")
val taskDefinitionKey
@seratch
seratch / build.sbt
Created December 1, 2011 06:07
Scala School - Testing with specs2 examples
organization := "net.seratch"
name := "sandbox"
version := "0.1"
scalaVersion := "2.9.1"
libraryDependencies ++= Seq(
"junit" % "junit" % "4.9" withSources(),
@jewelsea
jewelsea / TableWrappedHeaders.java
Last active July 11, 2024 18:46
JavaFX sample tableview with wrapped headers.
import javafx.application.Application;
import javafx.beans.property.SimpleStringProperty;
import javafx.collections.FXCollections;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.control.*;
import javafx.scene.control.cell.PropertyValueFactory;
import javafx.scene.layout.Pane;
import javafx.scene.layout.StackPane;
import javafx.scene.layout.VBox;
@4n3w
4n3w / example-pom.xml
Last active November 21, 2019 19:24
Configuration for the maven-replacer-plugin on two separate executions
<plugin>
<groupId>com.google.code.maven-replacer-plugin</groupId>
<artifactId>maven-replacer-plugin</artifactId>
<version>1.3.5</version>
<executions>
<execution>
<id>replace-for-documentation</id>
<phase>prepare-package</phase>
<goals>
<goal>replace</goal>
@emil10001
emil10001 / OkDownload.java
Created April 24, 2013 16:41
Playing around with Square's OkHttp library.
OkHttpClient client = new OkHttpClient();
// Ignore invalid SSL endpoints.
client.setHostnameVerifier(new HostnameVerifier() {
@Override
public boolean verify(String s, SSLSession sslSession) {
return true;
}
});
@bbirec
bbirec / gist:5748489
Last active June 7, 2019 00:56
ISO8601 Adapter for Gson.
package com.bbirec.dabang.common;
import com.google.gson.*;
import java.lang.reflect.Type;
import java.sql.Timestamp;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;