Skip to content

Instantly share code, notes, and snippets.

View h2000's full-sized avatar

Alf Richter h2000

  • iba Consulting Gesellschaft
  • Germany/Leipzig
View GitHub Profile
@480
480 / gist:3b41f449686a089f34edb45d00672f28
Last active May 10, 2026 01:08
MacOS X + oh my zsh + powerline fonts + visual studio code terminal settings

MacOS X + oh my zsh + powerline fonts + visual studio code (vscode) terminal settings

Thank you everybody, Your comments makes it better

Install oh my zsh

http://ohmyz.sh/

sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
@RichardBronosky
RichardBronosky / multiple_ssh_setting.md
Last active June 5, 2024 19:16 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "[email protected]"
@jrudolph
jrudolph / UpdateCopyrightHeaders.scala
Last active August 29, 2015 14:01
Simple script to update copyright headers
import java.io.{ FileOutputStream, File }
import scala.io.Source
import scala.util.matching.Regex
object UpdateCopyrightHeaders extends App {
val encoding = "utf-8"
val copyrightLines: Seq[String] = "Copyright (C) 1894-2014 Example Corp. <http://www.example.com>".split("\n")
val srcDir = new File("src/")
def updateCopyright(file: File): Unit = {
@echeipesh
echeipesh / CrudComponent
Last active August 29, 2015 14:00
Slick 2.0 CRUD Trait
trait Unique {
val id: String
}
/**
* Abstraction over a standard "Indexed" table.
*/
trait CrudComponent{ this: Profile =>
import profile.simple._
@h2000
h2000 / gist:4257993
Created December 11, 2012 11:50 — forked from int128/gist:2360407
GitLab init script for Gentoo Linux
#!/sbin/runscript
# GitLab init script for Gentoo Linux
# see https://github.com/gitlabhq/gitlabhq/blob/master/doc/installation.md
GITLAB_BASE=/home/gitlab/gitlab
GITLAB_USER=gitlab
depend() {
need net mysql redis
}
@bartschuller
bartschuller / ax.scala
Created May 5, 2012 21:09
Scala 2.10 Anti-XML literals with interpolation demo
// some data to interpolate
val attributes = Attributes("a"->"data wins", "b" -> "data loses")
val attributeValue = "one"
val nodes = Group(Elem("hi", Attributes()), Text(" there"))
// Scala 2.10's pluggable string interpolation
// Here xml"" means: create an Anti-XML element
val xml = xml"""<foo a="overridden" $attributes b="literal wins">blie <b attr=$attributeValue/> bla $nodes</foo>"""
@h2000
h2000 / filter
Created January 29, 2012 15:23 — forked from carstenlenz/filter
Eclipse Java code templates for google guava collections functionality
${retIt:newType(java.lang.Iterable)}<${iterable_type}> ${name:newName(retIt)} = ${itbls:newType(com.google.common.collect.Iterables)}.filter(${iterable}, new ${pred:newType(com.google.common.base.Predicate)}<${iterable_type}>() {
@Override public boolean apply(${iterable_type} ${input}) {
return ${false};
}
});
@bbejeck
bbejeck / ListenableFuturesTest.java
Created November 23, 2011 04:25
Unit test/sample code for ListneableFutures blog
import com.google.common.util.concurrent.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import java.util.concurrent.Callable;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.Executors;
@retronym
retronym / Bundle.scala
Created October 15, 2011 10:09
Outline of a OSGi BND plugin for SBT 0.11
import sbt._
import Keys._
import java.util.jar.Attributes.Name._
import sbt.Defaults._
import sbt.Package.ManifestAttributes
import sbt.Fork.ForkJava
object Bundle extends Plugin {
@brunoborges
brunoborges / DSLWicket.scala
Created July 27, 2011 15:22
Scala DSL for Wicket
package code.webapp
import scala.collection.JavaConversions.seqAsJavaList
import org.apache.wicket.behavior.AttributeAppender
import org.apache.wicket.datetime.markup.html.form.DateTextField
import org.apache.wicket.extensions.validation.validator.RfcCompliantEmailAddressValidator
import org.apache.wicket.markup.html.basic.{ MultiLineLabel, Label }
import org.apache.wicket.markup.html.form.{ TextField, TextArea, SubmitLink, RadioGroup, Radio, PasswordTextField, FormComponent, Form, DropDownChoice, CheckGroup, Button }
import org.apache.wicket.markup.html.link.{ Link, BookmarkablePageLink }
import org.apache.wicket.markup.html.link.ExternalLink