Skip to content

Instantly share code, notes, and snippets.

@antage
antage / install-rbenv-user.sh
Created December 1, 2011 14:56
System wide install rbenv on Debian
#!/bin/bash
# per-user install
echo 'if [ -z "$(type rbenv 2> /dev/null | head -1 | grep function)" ]; then' >> ~/.bashrc
echo ' export RBENV_ROOT=/usr/local/rbenv' >> ~/.bashrc
echo ' export PATH=$RBENV_ROOT/bin:$PATH' >> ~/.bashrc
echo ' eval "$(rbenv init -)"' >> ~/.bashrc
echo 'fi' >> ~/.bashrc
@gpr
gpr / PolymorphicAssociationWithSimpleForm.md
Last active August 29, 2018 11:47
How to manage polymorphic associations with simple_form and JQuery

Introduction

How to manage polymorphic associations with simple_form and JQuery?

This is a solution.

.
├── app
│   ├── assets
@alexisrobert
alexisrobert / dokku-backup.sh
Last active April 8, 2019 10:23
Backup script for Dokku (postgres & storage & let's encrypt & glacier)
#!/bin/bash
BACKUP_ROOT="/root/backup/"
BACKUP_DATE="`date +'%Y%m%d-%H%M%S'`"
BACKUP_FTP_ROOT="/tmp/glacier-${BACKUP_DATE}"
mkdir -p $BACKUP_FTP_ROOT
DAYS_RETENTION=30
@Epigene
Epigene / Dokku v0.5.6 Rails App.md
Last active January 5, 2024 14:48
Knowledge-Base for getting a Rails5 app with Cable running on dokku v0.5.6

Dokku v0.5.6 Rails workflow

Straight to Maintenance

0. Set up Droplet

Initialize the droplet with dokku app pre-setup
@glendaviesnz
glendaviesnz / example-test.spec.ts
Created May 16, 2018 23:54
Helper for testing Angular Material Select Menu changes in Unit Tests
import { ComponentFixture, TestBed, async, inject, fakeAsync, flush } from '@angular/core/testing';
import {
MatCheckboxModule,
MatSelectModule
} from '@angular/material';
import { By } from '@angular/platform-browser';
import { SelectMenuTestHelper } from './select-menu-test.helper';
describe('SelectOptionComponent', () => {