Skip to content

Instantly share code, notes, and snippets.

@ryands
ryands / docker-compose.yml
Created August 9, 2018 00:19
gitlab-ce omnibus docker behind a local nginx reverse proxy (letsencrypt ssl termination at local nginx)
version: '3'
services:
gitlab:
image: gitlab/gitlab-ce:latest
hostname: gitlab.example.com
environment:
GITLAB_OMNIBUS_CONFIG: |
external_url 'https://gitlab.example.com/'
nginx['listen_port'] = 80
nginx['listen_https'] = false
### Keybase proof
I hereby claim:
* I am ryands on github.
* I am ryands (https://keybase.io/ryands) on keybase.
* I have a public key ASAPVdyMPae0mgH03qbrDAal5GKi8SkCHyIyO_56yjsL0Ao
To claim this, I am signing this object:
@ryands
ryands / Person.java
Last active March 24, 2017 19:16
kotlin blogpost - snippets
public class Person {
public final String name;
public final int age;
public final String city;
public Person(String name, int age, String city) {
this.name = name;
this.age = age;
this.city = city;
}
@ryands
ryands / Presenter.java
Created October 24, 2016 21:00
super simple base presenter (similar to Mortar's Presenter class)
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.view.View;
public abstract class Presenter<V extends View> {
private V view;
public final void takeView(@NonNull V view) {
if (view == null) throw new NullPointerException("View must not be null");
if (this.view != view) {
@ryands
ryands / cloud-config.yml
Created May 26, 2016 19:38
example cloud-config
#cloud-config
coreos:
etcd2:
discovery: https://discovery.etcd.io/<some-discovery-token>
advertise-client-urls: http://\$private_ipv4:2379,http://\$private_ipv4:4001
initial-advertise-peer-urls: http://\$private_ipv4:2380
listen-client-urls: http://0.0.0.0:2379,http://0.0.0.0:4001
listen-peer-urls: http://\$private_ipv4:2380
units:
@ryands
ryands / pullrequest.5m.js
Last active February 4, 2016 17:39
Bitbar pull request monitoring
#!/usr/local/bin/node
// node.js BitBar plugin for pull-request tracking.
var https = require('https');
function pull_requests(options, cb) {
var repo = options.repo,
token = options.token;
https.get({
protocol: 'https:',
@ryands
ryands / cast.c
Created February 25, 2015 17:15
demonstrating casting and overflow (trivial)
/* gcc -o cast cast.c */
#include <stdio.h>
int main(int argc, char **argv) {
unsigned long sides;
int input = -5;
sides = input;
printf("Catas input %lu\n", sides);
@ryands
ryands / .tmux.conf
Created December 5, 2014 20:52
~/.tmux.conf
set-option -g prefix C-a
unbind-key C-b
bind-key C-a send-prefix
set-option -g status-style bg=blue
@ryands
ryands / debian.sh
Last active December 6, 2017 13:49
Debian KVM virt-install script
#!/usr/bin/env bash
INSTALL_MEDIA="http://cdimage.debian.org/cdimage/jessie_di_beta_2/amd64/iso-cd/debian-jessie-DI-b2-amd64-netinst.iso"
VMNAME="debian-jessie-vm"
[[ "x$1" != "x" ]] && VMNAME=$1
echo
echo "Building VM: $VMNAME"
echo " Creating disk image"
@ryands
ryands / proxy.js
Created August 4, 2014 21:57
quick node proxy for local XHR proxying
/* Local proxy for XHR testing
*
* Prereq: npm install express request lodash
* Running: node proxy.js
*
*/
// Configuration:
var port = 3001;
var mapping = {