View scala-sbt-project-structure.sh
#!/usr/bin/env bash
touch build.sbt ; touch README.md; mkdir -p project; touch project/plugins.sbt; mkdir -p src/{main/{scala,resources,java},test/{scala,resources,java}}/
View install-kibana-on-multiple-nodes.sh
#!/usr/bin/env bash
kibana_nodes=(server1 server2 server3)
elasticsearch_url=http://myelasticsearch.com
function install_kibana {
echo "install kibana"
sudo rpm -i https://download.elastic.co/kibana/kibana/kibana-4.6.1-x86_64.rpm
}
View git-author-rewrite.sh
#!/usr/bin/env bash
git filter-branch --env-filter '
OLD_EMAIL=$1
CORRECT_NAME=$2
CORRECT_EMAIL=$3
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
then
View setup-ruby.sh
#!/bin/bash
# https://gorails.com/deploy/ubuntu/14.04
cd
git clone git://github.com/sstephenson/rbenv.git .rbenv &
wait # wait for cloning to finish
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
exec $SHELL
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
View StackOverflow.java
import java.util.concurrent.atomic.AtomicInteger;
public class StackOverflow {
private static AtomicInteger atomicInteger = new AtomicInteger(0);
private static int staticInt = 0;
public static void main(String args[]) {
int atomicInt = atomicInteger.incrementAndGet();
staticInt++;
View ace_editor_in_bootstrap_3_container.html
<!DOCTYPE html>
<html lang="en">
<head>
<title>ACE in Action</title>
<style type="text/css" media="screen">
#editor {
height: 300px;
}
</style>
</head>
View import.rb
require 'rubygems'
require 'nokogiri'
require 'fileutils'
require 'date'
require 'uri'
# usage: ruby import.rb my-blog.xml
# my-blog.xml is a file from Settings -> Basic -> Export in blogger.
data = File.read ARGV[0]
View PrintWithoutSemiColon.java
public class PrintWithoutSemiColon {
public static void main(String[] args) {
if (System.out.printf("Hello World!\n") == null) {}
/**
* This one is given by Salil Joshi, in the following LinkedIn discussion
* http://www.linkedin.com/groups/How-print-Hello-World-in-3983267.S.252703117?qid=1ce0f1f0-73f3-4c31-ba37-c27aa8e81b55&trk=group_most_popular-0-b-ttl&goback=%2Egmp_3983267
*/
if (System.out.append("Hello World!\n").equals(null)) {}
View input.tagx.jsp
<jsp:root xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:fn="http://java.sun.com/jsp/jstl/functions" xmlns:spring="http://www.springframework.org/tags" xmlns:form="http://www.springframework.org/tags/form" xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0">
<jsp:output omit-xml-declaration="yes" />
<jsp:directive.attribute name="id" type="java.lang.String" required="true" rtexprvalue="true" description="The identifier for this tag (do not change!)" />
<jsp:directive.attribute name="field" type="java.lang.String" required="true" rtexprvalue="true" description="The field exposed from the form backing object" />
<jsp:directive.attribute name="label" type="java.lang.String" required="false" rtexprvalue="true" description="The label used for this field, will default to a message bundle if not supplied" />
<jsp:directive.attribute name="labelCode" type="java.lang.String" required="false" rtexprvalue="true" description="Key for label message bundle if label is not supplied" />
<jsp:directive.attr