Skip to content

Instantly share code, notes, and snippets.

@bruno-de-queiroz
bruno-de-queiroz / core.sh
Last active January 30, 2018 13:58
Autocomplete example and annotation parser for bash scripts to make easier to expose functions and flags, to create help info and short command list for autocompletion script
#!/bin/bash
#
# Autocomplete example and annotation parser for bash scripts to make easier to expose functions and flags,
# to create help info and short command list for autocompletion script
#
# Usage:
#
# source $SCRIPT_PATH/core.sh
# ...
# #@flag -e|--environment
@devacto
devacto / build.gradle
Created July 1, 2014 07:35
Example Gradle build file for use with Dropwizard.
apply plugin: 'java'
apply plugin: 'gradle-one-jar'
apply plugin: 'application'
// Use Java 8 by default
sourceCompatibility = 1.8
targetCompatibility = 1.8
version = '1.0'
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
@staltz
staltz / introrx.md
Last active June 6, 2025 03:30
The introduction to Reactive Programming you've been missing
@cxxr
cxxr / pom.xml
Created April 15, 2014 23:11
Example Root POM
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>root-pom</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Root POM</name>
<url>http://git.example.com/rootpom.git</url>
# Ubuntu upstart file at /etc/init/backup-agent.conf
description "MongoDB Monitoring Service (MMS) Backup Agent"
setuid nobody
setgid nogroup
pre-start script
if grep -q '@API_KEY@' /opt/backup-agent/local.config
then
@sargun
sargun / gist:5693318
Created June 2, 2013 11:07
New Upstart Script style
description "service"
start on filesystem
stop on runlevel S
respawn
respawn limit 10 5
oom never
kill timeout 86400 #If it's given a stop order, this is how long it will take to stop.
@balupton
balupton / README.md
Last active April 29, 2019 11:57
DocPad: Use DocPad, GitHub & Prose as a Wiki

Use DocPad, GitHub and Prose as a Wiki

This guide will walk you through how you can use a GitHub repository to house your wiki content, have DocPad render it, and automatically update on changes. It's also really nice as we get to benefit from the github project workflow for our wiki, that is issues, pull requests, etc.

We use this workflow heavily by linking the DocPad Website and the DocPad Documentation repositories allowing us to have users edit and submit pull requests for improvements to our documentation, and once merged, the website regenerates automatically.

1. Create a new repository for your Wiki Content

@tzachz
tzachz / gist:5047526
Created February 27, 2013 12:17
Dropwizard upstart file example
author "Your Name"
description "upstart script for sample-dw-service"
# respawn the job up to 5 times within a 10 second period.
# If the job exceeds these values, it will be stopped and
# marked as failed.
respawn
respawn limit 5 10
# move to this service's working directory
@naholyr
naholyr / _service.md
Created December 13, 2012 09:39
Sample /etc/init.d script

Sample service script for debianoids

Look at LSB init scripts for more information.

Usage

Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
@dwayne
dwayne / 00-install-on-64-bit-ubuntu-14.04.md
Last active January 12, 2024 17:48
Installing node and npm on Ubuntu 12.04 LTS and 64-bit Ubuntu 14.04 LTS.
  1. Navigate to http://nodejs.org/download/ and on the Linux Binaries (.tar.gz) row click to download the 64-bit version of the current latest release.

  2. Say you've downloaded node-v0.10.7-linux-x64.tar.gz into the Downloads directory. Then, open the terminal and type the following:

$ cd ~/Downloads
$ mkdir -p ~/local/node
$ tar xzf node-v0.10.7-linux-x64.tar.gz -C ~/local/node --strip-components=1
$ echo '# Node Enviroment Setup' >> ~/.bashrc
$ echo 'export PATH=$HOME/local/node/bin:$PATH' &gt;&gt; ~/.bashrc