Skip to content

Instantly share code, notes, and snippets.

@joepie91
joepie91 / .md
Last active June 10, 2024 14:18
Running a Node.js application using nvm as a systemd service

Read this first!

Hi there! Since this post was originally written, nvm has gained some new tools, and some people have suggested alternative (and potentially better) approaches for modern systems. Make sure to have a look at the comments to this article, before following this guide!


The original article

Trickier than it seems.

@estum
estum / switch_on.rb
Last active August 8, 2023 05:52
Ruby alternative switch-case syntax.
# = Kernel#switch
# Provides alternative switch-case syntax.
#
# # support methods:
# value = []
# switch value do
# on empty?: -> { "none" }
# on one?: -> { "one" }
# on many?: -> { "many" }
# end
@estum
estum / tabbable.rb
Last active August 29, 2015 13:56
Bootstrap 2 tabs helper method for Ruby on Rails
# helpers/bootstrap_helper/tabbable.rb
# Bootstrap 2 tabs helper method for Ruby on Rails
# http://getbootstrap.com/2.3.2/components.html
#
# == Usage (slim):
#
# = tabbable do |t|
# = t.section :tab_1 do
# / Content for Tab #1
@datenimperator
datenimperator / Gemfile
Created September 7, 2012 18:55
Sinatra, sprockets, compass, bootstrap-sass playing together
source :rubygems
gem 'shotgun', :group=>:development
gem 'rack-cache'
gem 'sinatra', :require => 'sinatra/base'
gem 'sinatra-support'
gem 'haml'
@lancejpollard
lancejpollard / class.coffee
Created October 23, 2011 05:25
ruby methods for coffeescript
moduleKeywords = ['included', 'extended', 'prototype']
class Class
# Rename an instance method
#
# ``` coffeescript
# class User
# @alias "methods", "instance_methods"
#
# ```