Skip to content

Instantly share code, notes, and snippets.

@wags
wags / dabblet.css
Created January 14, 2012 19:35 — forked from chriscoyier/dabblet.css
Untitled
.button {
border: 1px solid #DDD;
border-radius: 3px;
text-shadow: 0 1px 1px white;
box-shadow: 0 1px 1px #fff;
font: bold 11px Sans-Serif;
padding: 6px 10px;
white-space: nowrap;
vertical-align: middle;
color: #666;
@wags
wags / snippet-computername
Last active August 29, 2015 13:57
Get UniVerse Server Name
***
*** Get the computer name (Windows) from the data returned by the ENV[IRONMENT] command.
*** Local function technique requires UniVerse version 11.2 or greater
***
DEFFUN getComputerName
RESULT = getComputerName()
CRT "COMPUTER NAME IS ":RESULT
END
@wags
wags / gist:e6dcfb67d006a2a48a30
Created May 7, 2015 13:16
UniVerse - determine last day in current month
EOM = OCONV(ICONV(OCONV(@DATE+31,'D-YM[4,2]'):'-01','D-YMD[4,2,2')-1,'D-YMD[4,2,2]')
CRT "END OF MONTH: ":EOM
@wags
wags / DATE.UTILITY
Created June 11, 2015 13:52
Various date & time methods not handled by OCONV, eg.ISO8601, RFC1123
function DATE.UTILITY(method,arguments)
* DTV: Various date & time methods not handled by OCONV, eg.ISO8601, RFC1123
*// Stuart Boydell 2003-02-24
*//
*// Change E.DEFAULT.TZ for target server time zone locale.
*//
*// see http://www.timeanddate.com for more information about times and time zones
*//
*// Catalog this globally.
*// Call as either function ! i-type subr() with method and arguments.
@wags
wags / eclipse.ini
Created November 25, 2015 13:27
Customized .ini to pin Eclipse to Windows taskbar without duplicating the icon
-vm
C:/Program Files/Java/jre1.8.0_60/bin/server
-startup
plugins/org.eclipse.equinox.launcher_1.3.100.v20150511-1540.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.300.v20150602-1417
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
@wags
wags / elasticsearch-cluster-installation.md
Last active April 16, 2023 18:06
DRAFT - Elasticsearch Cluster Installation

Elasticsearch Cluster Installation & Configuration

A guide for installing and configuring an Elasticsearch cluster according to best practices. It contains a mix of setup steps and theory. Assuming that Ubuntu Server is already installed, and you have the server resources at your disposal (I used virtual machines), you can set up a complete, robust Elasticsearch cluster.

The information in this guide was assembled from the Elasticsearch documentation, notes from online training classes, and personal experience with the software.

What We're Building

A fully-functional Elasticsearch cluster consisting of nine total servers. There will be two client nodes, three master nodes and four data nodes. The theory section will provide insight into the node types and how to plan accordingly. The hands-on installation section will go through all the steps required to build it.

Theory

@wags
wags / elasticsearch-snippet-shard-reallocation.md
Last active December 29, 2015 20:30
Elasticsearch snippet for disabling / enabling shard reallocation. Useful when performing a rolling restart of the cluster, like during an upgrade.

Use this code before performing a rolling restart of an Elasticsearch cluster. The transient field means that the setting will be reset the next time Elasticsearch is restarted on the node.

Disable

PUT /_cluster/settings
{
  "transient": {
    "cluster.routing.allocation.enable": "none"
 }
@wags
wags / emoji_test.rb
Created April 19, 2016 13:48 — forked from holman/emoji_test.rb
A snapshot of the tests we use internally at GitHub to help edit our blog posts before they go out to everybody. For more information, take a peek at http://zachholman.com/posts/how-github-writes-blog-posts
require_relative "test_helper"
require "open-uri"
require "net/http"
class EmojiTest < Blog::Test
def test_no_emoji
posts.each do |post|
content = File.read(post)
refute_match /:[a-zA-Z0-9_]+:/, content,
@wags
wags / 00-about-search-api-examples.md
Created April 19, 2016 14:05 — forked from jasonrudolph/00-about-search-api-examples.md
5 entertaining things you can find with the GitHub Search API
@wags
wags / lint-shell-scripts.md
Created April 19, 2016 14:48
Lint Shell Scripts with Travis CI

Handy notes from this article.

git submodule add https://github.com/caarlos0/shell-travis-build.git build
cp build/travis.yml.example .travis.yml

Adds ShellCheck verification via Travis CI for any shell scripts in the repo.