This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
#=============================================================================== | |
# Ubuntu 14.04LTS Docker Installation Script | |
#=============================================================================== | |
# Maintainer: Matt Hartstonge <[email protected]> | |
# Description: | |
# Checks that your kernel version is up to scratch, otherwise prints errors. | |
# If Kernel is all good, will go ahead and do an automated install. | |
# | |
#------------------------------------------------------------------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* This script forces the first node in the config list to be master | |
*/ | |
cfg = rs.conf() | |
cfg.members[0].priority = 1 | |
cfg.members[1].priority = 0.5 | |
cfg.members[2].priority = 0.5 | |
rs.reconfig(cfg, {force: true}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
syntax = "proto3"; | |
package tz; | |
enum TimeZone { | |
Utc0000 = 0; // (UTC+-0:00) Coordinated Universal Time. | |
UtcMinus1200InternationalDateLineWest = 1; // (UTC-12:00) International Date Line West | |
UtcMinus1100MidwayIsland_Samoa = 2; // (UTC-11:00) Midway Island, Samoa | |
UtcMinus1000Hawaii = 3; // (UTC-10:00) Hawaii | |
UtcMinus0900Alaska = 4; // (UTC-09:00) Alaska | |
UtcMinus0800PacificTime = 5; // (UTC-08:00) Pacific Time (US & Canada) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// HTTPStatusCode provides all the known HTTP status codes. Since these codes | |
// are well known, it makes sense to use them as an easy way to detect, over | |
// the wire, if a message has been malformed, errors have happened or processed | |
// correctly. | |
enum StatusCode { | |
StatusCode_UNSPECIFIED = 0; | |
StatusCode_CONTINUE = 100; | |
StatusCode_SWITCHING_PROTOCOLS = 101; | |
StatusCode_PROCESSING = 102; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Enables simple cross-compilation and packaging of Go applications via Windows. | |
# | |
# Author: Matthew Hartstonge | |
# Written: 2017-10-12 | |
# Creates binaries packaged and ready to go in a distibution folder | |
function main() { | |
$operatingSystems = ("windows", "darwin", "linux", "openbsd", "freebsd", "solaris") | |
$architechtures = ("386", "amd64") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
REM If you haven't globally set up git, ensure your git user.email is the same as the email used for your signing key. | |
REM git config --global user.name My Name | |
REM git config --global user.email [email protected] | |
git config --global user.signingkey Y0UR51GN1NGK3Y | |
git config --global commit.gpgsign true | |
git config --global gpg.program "C:\Program Files (x86)\GnuPG\bin\gpg.exe" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library ninetyninebottlesofbeer; | |
class Song { | |
// in Dart, underscore denotes private variables. | |
// Private variables are scoped to a library, so you can still access privates | |
// within a given file/library from other classes/functions. | |
// Note the above declared library name to limit the scope.. | |
int _numBeers; | |
// The number of bottles of beers to sing from. | |
int bottlesOfBeer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:convert'; | |
import 'dart:io'; | |
// httpGet YOLO's a GET request to the given uri. | |
// Explosions may vary. | |
Future<dynamic> httpGet(String uri) { | |
return HttpClient(context: SecurityContext.defaultContext) | |
.getUrl(Uri.parse(uri)) | |
.then((HttpClientRequest request) { | |
// You can also do this simply as a string 'context-type' without the imported constant. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Modifier from 'ember-modifier'; | |
import { registerDestructor } from '@ember/destroyable'; | |
import { assert } from '@ember/debug'; | |
/** | |
* @modifier mutation-observer | |
* | |
* This Ember modifier uses the MutationObserver API to observe changes in the | |
* DOM of a given element. It initializes a MutationObserver, attaches it to | |
* the provided DOM element, and invokes a callback whenever a mutation is detected. |